-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Build: Run GitHub Action browser tests on Playwright WebKit #5190
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
Conversation
3adab2d to
752daba
Compare
So far, we've been running browser tests on GitHub Actions in Chrome and Firefox. Regular Safari is not available in GitHub Actions but Playwright WebKit comes close to a dev version of Safari. With this change, our GitHub CI will invoke tests on all actively developed browser engines on all PRs. Also, switch our GitHub Actions browser tests to use Node.js 18.
`karma-webkit-launcher` has a bug where it leaves orphaned WebKit processes around: google/karma-webkit-launcher#1 and this is not the best default experience. Instead, we allow to pass custom browsers when one needs it; e.g., to run the tests in all three engines on Linux/macOS, run: ``` grunt && BROWSERS=ChromeHeadless,FirefoxHeadless,WebkitHeadless grunt karma:main ``` Ref google/karma-webkit-launcher#1
The issues with WebKit processes not being killed have been fixed upstream.
|
The |
|
I also submitted google/karma-webkit-launcher#2 to be able to modify the user agent of the Playwright Webkit browser. That would help us with detecting the browser as we could attach some Playwright-identifying token. |
|
@dmethvin could you check if this works fine on Windows? |
|
@dmethvin I went ahead & merged it; we can sort out any potential Windows issues separately later. |
So far, we've been running browser tests on GitHub Actions in Chrome and Firefox. Regular Safari is not available in GitHub Actions but Playwright WebKit comes close to a dev version of Safari. With this change, our GitHub CI & local test runs will invoke tests on all actively developed browser engines on all PRs. Also, our GitHub Actions browser tests are now running on Node.js 18. Detection of the Playwright WebKit browser in support unit tests is done by checking if the `test_browser` query parameter is set to `"Playwright"`; this is a `karma-webkit-launcher` feature. Detecting that browser via user agent as we normally do is hard as the UA on Linux is very similar to a real Safari one but it actually uses a newer version of the engine. In addition, we now allow to pass custom browsers when one needs it; e.g., to run the tests in all three engines on Linux/macOS, run: ``` grunt && BROWSERS=ChromeHeadless,FirefoxHeadless,WebkitHeadless grunt karma:main ``` Closes gh-5190 (cherry picked from commit b02a257)
PR jquerygh-5190 added support for running tests on Playwright WebKit in CI. For efficiency reasons, Playwright dependencies are only installed for the `test:browser` npm script. However, that same script is also used for Firefox ESR testing. This change makes Playwright dependencies installed only for cases where `WebKitHeadless` exists on the list of tested browsers. Ref jquerygh-5190
PR gh-5190 added support for running tests on Playwright WebKit in CI. For efficiency reasons, Playwright dependencies are only installed for the `test:browser` npm script. However, that same script is also used for Firefox ESR testing. This change makes Playwright dependencies installed only for cases where `WebKitHeadless` exists on the list of tested browsers. Closes gh-5204 Ref gh-5190
PR jquerygh-5190 added support for running tests on Playwright WebKit in CI. For efficiency reasons, Playwright dependencies are only installed for the `test:browser` npm script. However, that same script is also used for Firefox ESR testing. This change makes Playwright dependencies installed only for cases where `WebKitHeadless` exists on the list of tested browsers. Closes jquerygh-5204 Ref jquerygh-5190 (cherry picked from commit e77bd9d)
Summary
So far, we've been running browser tests on GitHub Actions in Chrome and Firefox. Regular Safari is not available in GitHub Actions but Playwright WebKit comes close to a dev version of Safari.
With this change, our GitHub CI (& local test runs) will invoke tests on all actively developed browser engines on all PRs.
Also, switch our GitHub Actions browser tests to use Node.js 18.
In addition, we now allow to pass custom browsers when one needs it; e.g., to run the tests in all three engines on Linux/macOS, run:
I'd like to prepare a version for
3.xas well but that will be a bit more complex since the commonAppleWebKit/605.1.15token identifying Safari is only frozen in this version since Safari 13.Checklist
New tests have been added to show the fix or feature worksIf needed, a docs issue/PR was created at https://github.com/jquery/api.jquery.com