Repository navigation
[SDK-7898] Support WebdriverIO 10 in Accessibility Automation - #278
Dalwin-Barnard wants to merge 12 commits into
Conversation
webdriverio 10 removed browser.executeAsync, so the CLI accessibility scan, save-results, results and summary calls now go through the existing executeAccessibilityScript helper, which runs the same callback-style scripts via execute. The BiDi executor patch skips the executeAsync overwrite when the command does not exist, and the service accepts @wdio/cli ^10 as a peer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…O 10 webdriverio 10 rejects the boolean third argument of overwriteCommand, so every command wrap was skipped and only the end-of-test scan ran. overwriteCommandCompat retries with the options object the new API expects, and refuses element overrides for commands v10 removed, since v10 validates those only when the first element is created. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
FYI: #270 |
| try { | ||
| return overwrite(name, fn, attachToElement) | ||
| } catch (err) { | ||
| if (!String(err).includes('removed in WebdriverIO v10')) { | ||
| throw err | ||
| } | ||
| if (attachToElement && WDIO_V10_REMOVED_ELEMENT_COMMANDS.has(name)) { | ||
| throw new Error(`overwriteCommand: no command to be overwritten: ${name}`) | ||
| } | ||
| return overwrite(name, fn, { attachToElement }) | ||
| } |
There was a problem hiding this comment.
v10 is detected only by wdio error text, so if a 10.x release rewords it, wraps fail silently at debug level and per-command scans stop again. Could we also retry when typeof browser.executeAsync !== 'function' (the same check service.ts uses), and add a test with a different error message?
There was a problem hiding this comment.
Good catch, done in cc3d03e. overwriteCommandCompat now treats the failure as v10 when either the error text matches or typeof browser.executeAsync !== 'function' (same check as _routeBidiExecutorToHttp in service.ts), then retries with { attachToElement }.
Tests added in util.test.ts:
- reworded error + no
executeAsync→ retries with the options object - v10 where the retry also fails → rethrows after two attempts
- the existing "rethrows any other error" case now carries
executeAsyncso it still represents <= 9
util / service / accessibilityModule suites: 426 passed, lint clean.
…sing executeAsync too The boolean-to-options retry was keyed only on the v10 error text, so a reworded message in a later 10.x would make every per-command wrap fall through to the callers' debug-level catch and silently stop auto-scans. Treat a browser without executeAsync as v10 as well, matching the check in service.ts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@percy/webdriverio still declares peer webdriverio <= 9. Revert once the WebdriverIO 10 regression has run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WebdriverIO 10 no longer attaches each instance to the multiremote object by name, so getCloudProvider threw and isBidiSession always returned false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WebdriverIO 10's Jasmine adapter no longer passes the top-level suite description to beforeSuite, so the suite title stayed unset and sessions were left unnamed. Derive it from the test's fullName in that case too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No findings in the reviewed source and test files. The Process integrityThe review gate could NOT certify this run — the verdict is held at
Change map (generated deterministically from the diff)graph LR
subgraph nwdio_service["wdio-service"]
npackages_browserstack_service_src_service_ts["service.ts<br/>~47 lines"]
npackages_browserstack_service_tests_service_test_ts["service.test.ts<br/>~47 lines"]
npackages_browserstack_service_src_cli_modules_accessibilityModule_ts["accessibilityModule.ts<br/>~42 lines"]
npackages_browserstack_service_tests_cli_modules_accessibilityModule_test_ts["accessibilityModule.test.ts<br/>~42 lines"]
npackages_browserstack_service_src_util_ts["util.ts<br/>~34 lines"]
npackages_browserstack_service_tests_util_test_ts["util.test.ts<br/>~34 lines"]
npackages_browserstack_service_package_json["package.json<br/>~22 lines"]
npackages_browserstack_service_src_accessibility_handler_ts["accessibility-handler.ts<br/>~10 lines"]
npackages_browserstack_service_tests_accessibility_handler_test_ts["accessibility-handler.test.ts<br/>~10 lines"]
npackages_browserstack_service_src_launcher_ts["launcher.ts<br/>~8 lines"]
n_npmrc[".npmrc<br/>~7 lines"]
n_changeset_pr_278_md["pr-278.md<br/>~6 lines"]
npackages_browserstack_service_src_constants_ts["constants.ts<br/>~4 lines"]
n_github_workflows_ci_yml["ci.yml<br/>~2 lines"]
n_nvmrc[".nvmrc<br/>~2 lines"]
npackage_json["package.json<br/>~2 lines"]
npackages_browserstack_service_src_Percy_PercyHelper_ts["PercyHelper.ts<br/>~2 lines"]
npackages_browserstack_service_src_cli_modules_uploadAttachmentModule_ts["uploadAttachmentModule.ts<br/>~2 lines"]
npackages_browserstack_service_src_custom_tags_handler_ts["custom-tags-handler.ts<br/>~2 lines"]
npackages_browserstack_service_tests_Percy_Handler_test_ts["Percy-Handler.test.ts<br/>~2 lines"]
npackages_browserstack_service_tests_PercyHelper_test_ts["PercyHelper.test.ts<br/>~2 lines"]
npackages_browserstack_service_tests_insights_handler_test_ts["insights-handler.test.ts<br/>~2 lines"]
end
↻ 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 |
What is this about?
Makes
mainthe WebdriverIO 10 line and ships it as 10.0.0 (major). 9.x now lives on thev9branch and 8.x onv8, somaindrops the v8/v9 compatibility code and targets WebdriverIO 10 only. Currentmainis merged in.WebdriverIO 10 removed
browser.executeAsyncand the boolean third argument ofoverwriteCommand(v10 migration guide). On a v10 project every accessibility scan failed withbrowser.executeAsync is not a function, and every per-command wrap was silently skipped.accessibilityModule.ts: the scan, save-results, results and summary scripts (desktop and mobile) all run throughexecuteAccessibilityScript, which wraps the callback-style scripts in a promise and runs them withexecute.util.ts:overwriteScanCommandregisters per-command wraps with v10's{ attachToElement }option. It refuses element overrides for commands v10 removed (touchAction): v10 validates those only when the first element is created, so the error would otherwise surface inside the user's test. Used by the CLI module and the legacy accessibility handler.service.ts: the BiDibrowserstack_executorrouting patch overwritesexecuteonly; there is noexecuteAsyncto patch.isMultiremote→isMultiRemote,Capabilities.RequestedMultiremoteCapabilities→RequestedMultiRemoteCapabilities(service.ts,util.ts,launcher.ts,accessibility-handler.ts,custom-tags-handler.ts,Percy/PercyHelper.ts).package.json:webdriverio,@wdio/types,@wdio/logger,@wdio/reporter,@wdio/globals→^10.0.0; the@wdio/clipeer range adds^10.0.0and keeps the older majors;engines.node→>=22.19.0(WebdriverIO 10's floor). Rootengines,.nvmrcand the CI matrix (Node 22, 24) follow..changeset/pr-278.md: hand-writtenmajorchangeset with the upgrade notes; the PR hasskip-changesetso the generator doesn't replace it.Blocked on Percy:
@percy/webdriverio(latest 3.3.4) declares peerwebdriverio ~6 || ~7 || ~8 || ~9, sonpm ci(here and in any WebdriverIO 10 project) stops withERESOLVEuntil Percy releases WebdriverIO 10 support (percy/percy-webdriverio#1498, #1517). CI's install step fails until then; this PR doesn't merge or release before that.Validation (v10-only version, Node 22.23.2, installed locally with
legacy-peer-depsfor the Percy peer only):npm run buildandnpm run lintpass.vitest: 1401 pass, 76 fail. The 76 are the same tests that fail on a cleanmaincheckout on the same machine (network-dependent), so none come from this change.--wdio_versions v10(all products, including App Accessibility, whose scans now useexecute).Earlier validation (v9/v10-compatible version of this PR, before the rework):
vitest: 61 files / 1388 tests pass, lint clean.npm linked into the BStackAutomationautomate/wdio_cucumbersample on webdriverio 10.0.2 /@wdio/local-runner10.0.2: launcher and workers load the service and reach the hub.tests/a11y/wdio_mocha/wdio_mocha_wrapper/test_a11y_wdio_mocha_wrapper_default.pyon--wdio_versions v10 --agent_install True --branch_name SDK-7898_wdio_v10_compat(final branch): 12/12 pass (0/12 in regression buildWDIO SDK-QA Automation #47). Accessibility build created, WCAG / needs-review / framework / scanner-version assertions green, both sessions passed, and the text-log check sees theclick-triggered scan. Against the first commit alone it was 11/12, the missingclickscan is what led tooverwriteCommandCompat.wdio_mochaa11y sample with the rebuilt service linked: spec passed, service log showsAccessibility scan performed after url commandand... after click command, Automate text log shows scan requests withmethod: url,method: clickand the end-of-test scan, plus save-results success.Related Jira task/s
https://browserstack.atlassian.net/browse/SDK-7898
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
.changeset/pr-278.md; the template only offers minor/patch)Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
@wdio/browserstack-service10.0.0 supports WebdriverIO 10, including Accessibility Automation with per-command auto-scans. It requires WebdriverIO 10 and Node.js 22.19 or later. WebdriverIO 9 projects stay on 9.x (@wdio/browserstack-service@v9), WebdriverIO 8 projects on 8.x (@v8).Release notes (internal): (required — engineer-facing; what actually changed / why)
mainis WebdriverIO 10 only: no v8/v9 compatibility paths. All accessibility scripts run viaexecuteAccessibilityScript(execute); per-command wraps useoverwriteScanCommand({ attachToElement }, skips v10-removedtouchAction); the BiDi patch no longer overwritesexecuteAsync;isMultiRemote/RequestedMultiRemoteCapabilitiesrenames.^10.0.0; the@wdio/clipeer range adds^10.0.0; Node floor>=22.19.0; CI on Node 22/24.skip-changesetlabel). Blocked on a Percy release with WebdriverIO 10 support.Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.
🤖 Generated with Claude Code