Repository navigation
fix(service): open the dashboard over WebDriver, not the devtools protocol - #422
Merged
Merged
Conversation
…tocol automationProtocol 'devtools' needs the devtools package, so the service declared devtools ^8.42.0 as a peer and npm installed it, plus an old Puppeteer, into every project. On WebdriverIO 10 the dashboard window failed to open when it was absent. chromedriver is already resolved for the test sessions, so the launcher uses it too.
|
The comment still said the dashboard used the devtools protocol and had to hide the infobar with ignoreDefaultArgs, inviting someone to undo the excludeSwitches setting. The cast it justified is no longer needed.
3 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The launcher opened the dashboard window with
remote({ automationProtocol: 'devtools' }). That protocol is implemented by thedevtoolspackage, so the service declareddevtools^8.42.0as a peer, and npm installed it together withpuppeteer-core@21into every project that added the service.On WebdriverIO 10 this breaks the dashboard. A fresh
create-wdio@10.0.1project that selects the devtools service works only while npm happens to auto-install that peer. Without it (for example afternpm i --legacy-peer-deps),onPreparefails with:The tests still run, but no dashboard window opens.
The launcher now opens the window over WebDriver, through the same chromedriver the test sessions already resolve, and
devtoolsis no longer a peer:launcher.ts: dropautomationProtocol: 'devtools'; quiet thewebdriverlogger instead ofdevtoolswhile polling for the window to close.constants.ts: hide the "controlled by automated test software" bar with chromedriver'sexcludeSwitches: ['enable-automation']instead of the Puppeteer-onlywdio:devtoolsOptions.ignoreDefaultArgs.package.json: remove thedevtoolspeer. The lockfile change is only that importer entry.patchfor@wdio/devtools-service.Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API —@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)Notes for reviewers
create-wdio@10.0.1project (mocha,@wdio/*10.0.1) with this branch's service, backend, script, elements and app packed and installed with plainnpm install:devtoolsandpuppeteer-core@21are no longer installed, the dashboard opens with no automation bar, the login spec passes with its actions, console and network captured, and closing the window ends the run.webdriverio9.32.0 to 9.30.1), so only the three-linedevtoolsentry underpackages/serviceis removed.pnpm install --frozen-lockfilepasses.nightwatch-devtoolsopens its dashboard the same way (run-lifecycle.ts) and has the samedevtoolspeer. It still works because that adapter depends onwebdriverio^9; it should get the same change before it moves to v10. Kept out to hold this PR to one adapter.accept-webdriverio-v10andshare-the-projects-wdio-packageschangesets. Together they are what acreate-wdio@10project needs to install the service without workarounds.pnpm build,pnpm test(2500 passed),pnpm typecheckandpnpm lint(0 errors) are green locally.Screenshots / recordings
Not a UI change. The dashboard window looks the same as before; only how it is launched changed.