Repository navigation
fix(selenium-devtools): apply port, hostname and capture options in configure() - #430
Merged
Merged
Conversation
…onfigure() DevTools.configure() accepted only eleven keys, so port, hostname, captureScreenshots, filmstrip and emitArtifactsManifest were declared on DevToolsOptions and documented, yet silently ignored. The plugin is built with no options, so configure() is the only way to set anything and the defaults always applied. configure() now takes DevToolsOptions and copies every option through a Record keyed on that type, so an option added later fails to compile until it is handled. A rerun keeps its parent's backend whatever port the test file asks for, since a rerun loads the file again; port and hostname passed after the backend start has begun are ignored with a warning, and null values or an invalid port are refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
4 of 16 tasks
Contributor
|
JS callers bypass the option types, and configure() copied any defined
value straight through. The string 'false' is truthy, so
DevTools.configure({ headless: process.env.HEADLESS }) with HEADLESS=false
turned headless on.
The old per-option boolean checks are restored as per-kind shape checks
covering every option (boolean, non-empty string choice, port, host). A
value of the wrong shape is refused with a warning naming the option, the
expected shape and the value, instead of being applied or silently dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 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
DevTools.configure()accepted only eleven keys.port,hostname,captureScreenshots,filmstripandemitArtifactsManifestare declared onDevToolsOptions, read by the plugin's constructor and documented in the README and on the website, butconfigure()dropped them. The plugin is constructed with no options, soconfigure()is the only way to set anything: those five always ran at their defaults, and a TypeScript caller got a type error while a JavaScript caller got silence.This makes
configure()takeDevToolsOptionsand apply all of them:helpers/configure-options.ts, keyed by aRecordoverDevToolsOptions, so an option added later fails to compile until it is handled instead of being silently dropped again.configure({ port })there would otherwise point the child at a port no dashboard is listening on. Port and hostname are skipped silently in that case, because that is the rerun working.nulland an invalid port (NaN, out of range) are not applied.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
pnpm build,pnpm test(2518 passed) andpnpm lintare green. Lint shows no new warnings: the same 4 as onmainin this package.port/hostnametake effect. The matching website page is updated in the companion webdriverio docs PR, which should merge after this ships in a release.🤖 Generated with Claude Code