Skip to content

fix(a11y): restore per-command auto-scanning for App Automate a11y sessions#73

Open
AakashHotchandani wants to merge 3 commits into
mainfrom
APPA11Y-5542-restore-app-command-wrapping
Open

fix(a11y): restore per-command auto-scanning for App Automate a11y sessions#73
AakashHotchandani wants to merge 3 commits into
mainfrom
APPA11Y-5542-restore-app-command-wrapping

Conversation

@AakashHotchandani

@AakashHotchandani AakashHotchandani commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What & why

App Automate accessibility sessions were excluded from the per-command overwriteCommand wrapping in onBeforeExecute — the wrap was guarded to !this.isAppAccessibility (added by the SDK-3813 routing fix). The intent was to avoid overwriteCommand throwing on commands the appium driver doesn't register. But the side effect was that per-command auto-scanning was disabled entirely for App Automate — app a11y scans could only fire via an explicit browser.performScan() or the end-of-test lifecycle scan, unlike web sessions which auto-scan on every wrapped DOM command.

This restores per-command auto-scanning for app while keeping the safety the guard was trying to provide:

  • Command wrapping now applies to app sessions too (drop the !isAppAccessibility condition).
  • Each overwriteCommand call is wrapped in its own try/catch, so a command the appium driver doesn't register is skipped (debug-logged) instead of aborting the whole wrap loop / onBeforeExecute.
  • Commands appium does register (click, setValue, …) now auto-scan on App Automate, matching the web flow.

Evidence

Empirically verified on prod: the pre-regression release (@wdio/browserstack-service@9.29.1, before this routing change) auto-scanned app DOM commands (click, addValue) with no manual performScan(). A build with this fix reproduced that per-command auto-scan on App Automate. The prior blanket-skip is what removed it; this change brings it back without the abort risk.

Tests

Updated the SDK-3813 unit tests (which asserted overwriteCommand was skipped for app) to assert app sessions now wrap, and that an individual command wrap throwing does not abort onBeforeExecute. All 26 accessibilityModule tests pass locally.

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

  • fix: Accessibility command wrapping.

Release notes (internal): (required — engineer-facing; what actually changed / why)

  • fix: Accessibility command wrapping.

🤖 Generated with Claude Code

…ssions

App Automate accessibility sessions were excluded from the per-command
overwriteCommand wrapping in onBeforeExecute (guarded to !isAppAccessibility),
so app a11y scans only fired via an explicit performScan() or the end-of-test
lifecycle scan. Wrap commands for app sessions too, guarding each overwriteCommand
individually so a command the appium driver does not register is skipped
(debug-logged) instead of aborting onBeforeExecute. Commands appium registers
(click, setValue, ...) now auto-scan on App Automate, matching the web flow.

Updates the SDK-3813 tests that asserted overwriteCommand was skipped for app.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kamal-kaur04
kamal-kaur04 previously approved these changes Jul 24, 2026
xxshubhamxx
xxshubhamxx previously approved these changes Jul 24, 2026
@github-actions
github-actions Bot dismissed stale reviews from kamal-kaur04 and xxshubhamxx via 1a973e9 July 24, 2026 15:03
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ The ready-for-review label was removed because the PR body does not pass the release gate:

  • Tick - [x] Ready to review once the PR body is complete.

How to get (and keep) the ready-for-review label:

  1. Make sure the PR body follows the repo PR template (all sections present).
  2. In the ## Release section, tick exactly one version bump (minor or patch).
  3. Fill in at least one bullet under **Release notes (internal):** (engineer-facing; feeds the internal CHANGELOG.md).
  4. Tick - [x] Ready to review in the checklist.
  5. Apply the ready-for-review label yourself — this workflow does NOT add it for you; it only removes it if the body stops passing, and the check stays red until the label is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants