-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
refactor(test-runner-saucelabs): use webdriver launcher #1053
refactor(test-runner-saucelabs): use webdriver launcher #1053
Conversation
🦋 Changeset detectedLatest commit: 97c6343 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// W3C capabilities: only browserVersion is mandatory, platformName is optional. | ||
// Note that setting 'sauce:options' forces SauceLabs to use W3C capabilities. | ||
if (capabilities.browserVersion) { | ||
finalCapabilities.platformName = | ||
finalCapabilities.platformName || finalCapabilities.platform || 'Windows 10'; | ||
finalCapabilities['sauce:options'] = { | ||
...finalSauceCapabilities, | ||
...(finalCapabilities['sauce:options'] || {}), | ||
}; | ||
|
||
// Delete JWP capabilities, if any. | ||
delete finalCapabilities.version; | ||
delete finalCapabilities.platform; | ||
} else { | ||
// JWP capabilities for remote environments not yet supporting W3C. | ||
// This enables running tests on iPhone Simulators in SauceLabs. | ||
finalCapabilities = { ...finalCapabilities, ...finalSauceCapabilities }; | ||
} |
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.
These are the lines that do the trick to fix #788. The solution is copied from karma-sauce-launcher
.
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.
LGTM
@@ -46,11 +46,12 @@ | |||
], | |||
"dependencies": { | |||
"@web/dev-server-esbuild": "^0.2.4", | |||
"@web/test-runner-selenium": "^0.3.3", | |||
"@web/test-runner-webdriver": "^0.0.3", |
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.
❤️
// W3C capabilities: only browserVersion is mandatory, platformName is optional. | ||
// Note that setting 'sauce:options' forces Sauce Labs to use W3C capabilities. | ||
if (capabilities.browserVersion) { | ||
finalCapabilities.platformName = |
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.
Is this needed to fix a bug? Otherwise I prefer that the defaults are set by saucelabs, not by us.
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.
If you set browserVersion
with platform
(instead of platformName
), then the following error will happen:
"message": "Illegal key values seen in w3c capabilities: [platform]",
"error": "unknown error",
Removed the fallback to Windows 10
to let Sauce Labs choose the default platform as you suggested.
|
||
// Delete JWP capabilities, if any. | ||
delete finalCapabilities.version; | ||
delete finalCapabilities.platform; |
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.
Why do we need to delete these?
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.
Updated to document that non-W3C capabilities need to be removed.
What I did
@web/test-runner-saucelabs
to depend on@web/test-runner-webdriver
createSauceLabsLauncher
to accept three arguments, to allow passing sharedsauceLabsCapabilities
instead of having to include them to every launcher individually.The second change is required to support JWP capabilities and especially iOS Simulators, and fixes #788
/cc @christian-bromann I would appreciate if you have time to take a quick look 🙇♂️