-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove unknown capabilities when running local browser #1044
fix: remove unknown capabilities when running local browser #1044
Conversation
3cd7d66
to
2eb808c
Compare
const filteredCapabilities: WebdriverIO.Capabilities = Object.keys(capabilities) | ||
.filter(capabilityName => { | ||
const isW3CCapability = W3C_CAPABILITIES.includes(capabilityName); | ||
const isVendorSpecificCapability = VENDOR_CAPABILITIES[browserNameW3C].includes(capabilityName); | ||
|
||
return isW3CCapability || isVendorSpecificCapability; | ||
}) | ||
.reduce((acc, capabilityName) => { | ||
return set(acc, [capabilityName], capabilities[capabilityName as keyof WebdriverIO.Capabilities]); | ||
}, {}); | ||
|
||
return filteredCapabilities; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all capabilities, which are not "w3c capabilities" or "vendor specific capabilities", as local webdriver can't recognize those and fail to launch browser
781ca7b
to
6ab67ec
Compare
return set(acc, [capabilityName], capabilities[capabilityName as keyof WebdriverIO.Capabilities]); | ||
}, {}); | ||
|
||
return filteredCapabilities; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to write a message if some capabilities were omitted, because I think we might stumble on this in the future in circumstances we can't foresee now. Something like "Dropping non-standard capabilities due to running in local mode". Perhaps this should be in debug logs.
6ab67ec
to
6e75965
Compare
No description provided.