Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

KuznetsovRoman
Copy link
Member

No description provided.

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-384.local_remove_unknown_caps branch from 3cd7d66 to 2eb808c Compare December 24, 2024 15:24
Comment on lines +263 to +274
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;
Copy link
Member Author

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

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-384.local_remove_unknown_caps branch 3 times, most recently from 781ca7b to 6ab67ec Compare December 26, 2024 17:36
return set(acc, [capabilityName], capabilities[capabilityName as keyof WebdriverIO.Capabilities]);
}, {});

return filteredCapabilities;
Copy link
Member

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.

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-384.local_remove_unknown_caps branch from 6ab67ec to 6e75965 Compare January 13, 2025 02:31
@KuznetsovRoman KuznetsovRoman merged commit fe0c7da into master Jan 13, 2025
2 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-384.local_remove_unknown_caps branch January 13, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants