🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented Jan 3, 2023

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:

grunt && BROWSERS=ChromeHeadless,FirefoxHeadless,WebkitHeadless grunt karma:main

I'd like to prepare a version for 3.x as well but that will be a bit more complex since the common AppleWebKit/605.1.15 token identifying Safari is only frozen in this version since Safari 13.

Checklist

  • New tests have been added to show the fix or feature works
  • Grunt build and unit tests pass locally with these changes
  • If needed, a docs issue/PR was created at https://github.com/jquery/api.jquery.com

@mgol mgol added Needs review Build Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Jan 3, 2023
@mgol mgol added this to the 4.0.0 milestone Jan 3, 2023
@mgol mgol self-assigned this Jan 3, 2023
@mgol mgol removed the Needs review label Jan 3, 2023
@mgol mgol marked this pull request as draft January 3, 2023 18:19
@mgol mgol changed the title Build: Run GitHub Action browser tests on Puppeteer WebKit Build: Run GitHub Action browser tests on Playwright WebKit Jan 3, 2023
@mgol mgol force-pushed the webkit-tests branch 4 times, most recently from 3adab2d to 752daba Compare January 3, 2023 18:46
@mgol mgol removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jan 3, 2023
@mgol mgol removed this from the 4.0.0 milestone Jan 3, 2023
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.
@mgol mgol added Needs review Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Jan 4, 2023
@mgol mgol added this to the 4.0.0 milestone Jan 4, 2023
@mgol mgol marked this pull request as ready for review January 4, 2023 15:00
`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.
@mgol
Copy link
Member Author

mgol commented Jan 11, 2023

The karma-webkit-launcher issues relevant for us, google/karma-webkit-launcher#1 & google/karma-webkit-launcher#3, have been fixed upstream so I re-enabled those tests even locally. 🎉

@mgol
Copy link
Member Author

mgol commented Jan 11, 2023

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.

@mgol mgol removed this from the 4.0.0 milestone Jan 11, 2023
@mgol
Copy link
Member Author

mgol commented Jan 23, 2023

@dmethvin could you check if this works fine on Windows?

@mgol mgol requested a review from dmethvin January 23, 2023 17:20
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jan 23, 2023
@mgol mgol removed the Needs review label Jan 23, 2023
@mgol mgol merged commit b02a257 into jquery:main Jan 23, 2023
@mgol mgol deleted the webkit-tests branch January 23, 2023 22:49
@mgol
Copy link
Member Author

mgol commented Jan 23, 2023

@dmethvin I went ahead & merged it; we can sort out any potential Windows issues separately later.

mgol added a commit that referenced this pull request Jan 23, 2023
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)
@mgol mgol modified the milestones: 4.0.0, 3.7.0 Jan 23, 2023
@mgol
Copy link
Member Author

mgol commented Jan 23, 2023

Landed on main in b02a257 and on 3.x-stable (with slight modifications) in da7057e.

mgol added a commit to mgol/jquery that referenced this pull request Feb 6, 2023
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
mgol added a commit that referenced this pull request Mar 20, 2023
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
mgol added a commit to mgol/jquery that referenced this pull request Mar 20, 2023
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)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

2 participants