Skip to content

A11Y-13878 (v9): Scan iPhone Safari without the binary; clearer a11y-off messaging - #354

Open
palspal-bstack wants to merge 5 commits into
v9from
A11Y-13878-wdio-mobile-followups-v9
Open

palspal-bstack wants to merge 5 commits into
v9from
A11Y-13878-wdio-mobile-followups-v9

Conversation

@palspal-bstack

@palspal-bstack palspal-bstack commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What is this about?

v9 port of #352 (main). Same four commits cherry-picked onto v9; the code diff is identical to #352's. Replaces #353, which targeted v9 from #352's branch.

Follow-up to #311 (mobile web accessibility), from the product review of Safari on iPhone.

  • Safari on iPhone without the binary: the in-process flow (jasmine, multiremote, or mocha/cucumber when the binary isn't running) sent every scan, results, summary and save script through browser.execute wrapped in a Promise. iOS Safari doesn't await it, so they all returned {}, with no scans, no report and no warning. A11Y-13878: Scan Chrome on Android and Safari on iPhone for accessibility #311 passed the mobile args and set the script timeout on this path, but not the executor. executeAccessibilityScript now uses executeAsync on mobile sessions, as the CLI flow does. Desktop is unchanged.
  • No empty report on an unsupported-only run: sessions turn accessibility off on unsupported mobile platforms (iPhone below iOS 18, iPad, non-Chrome on Android), but the build had already started it, so the dashboard showed an empty report. When every capability is such a platform, the launcher now warns once and turns accessibility off before build start. Plain, alwaysMatch, parallel-multiremote and multiremote capabilities are all checked. App Automate runs are skipped (App Accessibility has its own platform rules). Mixed and desktop runs are unchanged.
  • includeIssueType.advanced: true with a mobile capability: warns once that advanced rules don't run on mobile browsers (scans already skip them).
  • Build start without accessibility (CLI flow): when accessibility was requested but the binary's build start didn't start it, the user now gets a warning instead of a silent run; the cause was only in log/sdk-cli.log.
  • No-op a11y commands in the CLI flow: the CLI flow adds getAccessibilityResultsSummary / getAccessibilityResults / performScan / startA11yScanning / stopA11yScanning only when the build started accessibility, so a test calling one threw is not a function. Whenever the CLI flow runs, any of them still missing is now added as a no-op ({}, [], undefined); the classic flow already always adds them. Commands the accessibility module added are left alone.

Not in this PR: the v8 branch, and main (#352).

Tested on prod (WDIO 9.32.0, packed build of #352's branch, same code as this PR, bstackdemo.com, one session at a time)

"No binary" = mocha with the CLI framework list emptied locally, so it takes the in-process flow. Counts are summary with no start / performScan() / summary after start-stop, with autoScanning: false.

Flow Platform Before (9.44.0) This branch O11y build
Mocha, no binary iPhone 17 / iOS 26 {} / {} / {} 59 / 7 / 71 oxhea9ub
Jasmine iPhone 17 / iOS 26 {} / {} / {} 59 / 7 / 71 78wj1zyx
Mocha, binary iPhone 17 / iOS 26 59 / 7 / 71 59 / 7 / 71 1sv5pvr6
Mocha, no binary Windows 11 Chrome 151 55 / 5 / 62 55 / 5 / 62 0autiuak
Mocha, binary Windows 11 Chrome 151 5 / 5 / 62 5 / 5 / 62 irfjjjwk
Jasmine Windows 11 Chrome 151 5 / 5 / 62 5 / 5 / 62 vwyqi7ba

The first desktop count varies between 5 and 55 on both versions: the sample calls the summary straight after a click, while the page is changing.

Scenario Result O11y build
iPhone 15 / iOS 17 only, binary Test passes; warns "Accessibility Automation will run only on Desktop browsers, Chrome on Android or Safari on iPhone with iOS 18 or later."; summary {}; no a11y build (a11y builds API 404) l52ias7j
iPhone 15 / iOS 17 only, no binary Same; no a11y build j9vfl1fb
iPhone 17, advanced: true, binary Warns "Advanced accessibility rules are not supported on mobile browsers. Mobile sessions run the standard rules only."; scans unaffected (67 / 11) dv97mfjf

Chrome on Android, binary on / off (Galaxy S25 / Android 15, autoScanning: false; same three counts as above):

Flow 9.44.0 This branch O11y build (branch)
Mocha, binary 56 / 7 / 67 7 / 7 / 67 ur5etluc
Mocha, no binary 56 / 7 / 67 56 / 7 / 67 r0swhydo
Jasmine — 56 / 7 / 67 8bfnaveo

No change on Android; the first count is the same click-then-summary race. Chrome on Android already awaited the Promise from execute, so the executeAsync switch only changes iOS Safari.

Mixed-platform builds (mocha, default options, sessions in parallel within each build). Summary per session is tagged / excluded test; platforms are from the a11y builds API's osData / browserData:

Build Binary Summary per session a11y report test cases O11y build
iPhone 17 + Galaxy S25 + Win 11 Chrome on iOS 67 / 11 · Android 63 / 11 · desktop 60 / 7 6: iOS 26 Safari ×2, Android 15 Chrome ×2, Windows 11 Chrome ×2 zciyr6aj
same off same counts 6, same platforms 2iiwu0cf
+ iPhone 15 / iOS 17 on others as above · iPhone 15: warning, summary undefined 6: iPhone 15 adds none rzk9yjhg
same off others as above · iPhone 15: warning, summary {} 6: iPhone 15 adds none 3wk1mh8f

All 13 sessions pass. One unsupported device doesn't turn accessibility off for the rest of the build. The undefined vs {} for an unsupported session is from main (the CLI module returns early when this.accessibility is false); not changed here.

Before the no-op commands, the iPhone 15 binary run failed with browser.getAccessibilityResultsSummary is not a function; that is what added the last bullet above.

Unit tests: new coverage for executeAsync on mobile vs execute on desktop, the requested-platform helper, the launcher's unsupported-only (array and multiremote), App Automate and advanced checks, the build-start warning and the no-op commands; one existing test updated to expect executeAsync on iPhone. vitest on util, launcher, service and cli/frameworks/index tests: the same 62 failures as main (network-backed tests), no new ones. tsc --noEmit and ESLint clean.

Related Jira task/s

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)

  • Fixed accessibility scans returning no results on Safari on iPhone with Jasmine or multiremote.
  • Accessibility is no longer started for a build where every platform is unsupported, so no empty report is created; a warning explains why.
  • Added warnings when advanced rules are requested on mobile browsers and when accessibility could not be started for a build.

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

  • executeAccessibilityScript uses executeAsync on mobile sessions (iOS Safari doesn't await a Promise from execute/sync).
  • Launcher turns accessibility off before build start when every capability is an unsupported mobile platform; warns on includeIssueType.advanced with a supported mobile capability.
  • CLI main process warns when accessibility was requested but startBinSession didn't return it.
  • CLI flow adds no-op a11y browser commands when accessibility was requested but isn't running.

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

🤖 Generated with Claude Code

palspal-bstack and others added 4 commits November 11, 2026 18:30
…essaging

- Run a11y scripts with executeAsync on mobile in the in-process flow; iOS Safari doesn't await a Promise from execute/sync, so scans, results and save returned {}.
- Turn accessibility off at build start when every capability is an unsupported mobile platform, so no empty report is created.
- Warn once that advanced rules don't run on mobile browsers.
- Warn when accessibility was requested but the binary's build start didn't start it.
- Add no-op a11y commands in the CLI flow when accessibility isn't running, so tests calling them don't throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Leave App Automate runs to App Accessibility's own platform checks.
- Check multiremote and parallel-multiremote capabilities too.
- Add the no-op a11y commands whenever the CLI flow runs, not only when the worker's options say accessibility.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tack:options.device

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@palspal-bstack

Copy link
Copy Markdown
Collaborator Author

RUN_TESTS

@palspal-bstack

Copy link
Copy Markdown
Collaborator Author

✅ Good to go

File Confidence
.changeset/pr-354.md ✅ All Clear
packages/browserstack-service/src/cli/index.ts ✅ All Clear
packages/browserstack-service/src/launcher.ts ✅ All Clear
packages/browserstack-service/src/service.ts ✅ All Clear
packages/browserstack-service/src/util.ts ✅ All Clear
packages/browserstack-service/tests/cli/frameworks/index.test.ts ✅ All Clear
packages/browserstack-service/tests/launcher.test.ts ✅ All Clear
packages/browserstack-service/tests/util.test.ts ✅ All Clear

Change map (generated deterministically from the diff)

graph LR
  subgraph nwdio_browserstack_service["wdio-browserstack-service"]
    npackages_browserstack_service_src_launcher_ts["⚠ launcher.ts<br/>~50 lines"]
    npackages_browserstack_service_src_util_ts["⚠ util.ts<br/>~50 lines"]
    npackages_browserstack_service_tests_launcher_test_ts["⚠ launcher.test.ts<br/>~50 lines"]
    npackages_browserstack_service_tests_util_test_ts["⚠ util.test.ts<br/>~50 lines"]
    n_changeset_pr_354_md["pr-354.md<br/>~7 lines"]
    npackages_browserstack_service_src_cli_index_ts["index.ts<br/>~7 lines"]
    npackages_browserstack_service_src_service_ts["service.ts<br/>~7 lines"]
    npackages_browserstack_service_tests_cli_frameworks_index_test_ts["index.test.ts<br/>~7 lines"]
  end
Loading

↻ This verdict comment is the review anchor — it's updated in place on each run (the gate posts its status separately).

— SDK PR Review Agent

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

Copy link
Copy Markdown
Contributor

🟢 SDK PR Review gate is green — the SDK PR Review Agent has run on the current head commit (verdict: success).

This gate confirms a review ran on the latest commit. The verdict itself is advisory — read the findings and use your judgement; it does not block merge. A native GitHub reviewer approval is still separately required by branch protection before this PR can merge.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

🟢 SDK PR Review gate is green — the SDK PR Review Agent has run on the current head commit (verdict: success).

This gate confirms a review ran on the latest commit. The verdict itself is advisory — read the findings and use your judgement; it does not block merge. A native GitHub reviewer approval is still separately required by branch protection before this PR can merge.

@minionhelperappqa

Copy link
Copy Markdown

[SDK Wdio Test] TRA build state: failed | Stability 90% — verdict: failure. Passed: 52, Failed: 6, Aggregate: 58. TRA: https://observability.browserstack.com/builds/mchijtqhx9asvz22vwjbbsp16bmpub0sugaow0j5

@palspal-bstack

Copy link
Copy Markdown
Collaborator Author

RUN_TESTS

@minionhelperappqa

Copy link
Copy Markdown

[SDK Wdio Test] TRA build state: failed | Stability 91% — verdict: failure. Passed: 53, Failed: 5, Aggregate: 58. TRA: https://observability.browserstack.com/builds/4ogbvtjttpd3uwfncth67g55lbev8uh9adorls4s

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants