aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-01-23 23:49:44 +0100
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-01-24 00:12:55 +0100
commitda7057e9b0d48afdf5666597279f0a24e9828bc8 (patch)
treec17a010e93079ab65aa24cff808d4202f6d012ec /.github
parent6b2abbdc46e9c4c37f515e838a7f820a4f2bb91a (diff)
downloadjquery-da7057e9b0d48afdf5666597279f0a24e9828bc8.tar.gz
jquery-da7057e9b0d48afdf5666597279f0a24e9828bc8.zip
Build: Run GitHub Action browser tests on Playwright WebKit
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 b02a257f98688aa890e06a85672cd1a54c3ffa3a)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/node.js.yml26
1 files changed, 15 insertions, 11 deletions
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
index 41f29384a..23a5d02b1 100644
--- a/.github/workflows/node.js.yml
+++ b/.github/workflows/node.js.yml
@@ -16,28 +16,28 @@ jobs:
NODE_VERSION: [10.x, 14.x, 16.x, 18.x, 19.x]
NPM_SCRIPT: ["test:browserless"]
include:
- - NAME: "Browser tests: full build, Chrome & Firefox stable"
- NODE_VERSION: "16.x"
+ - NAME: "Browser tests: full build, Chrome, Firefox & WebKit"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:browser"
- BROWSERS: "ChromeHeadless,FirefoxHeadless"
- - NAME: "Browser tests: slim build, Chrome stable"
- NODE_VERSION: "16.x"
+ BROWSERS: "ChromeHeadless,FirefoxHeadless,WebkitHeadless"
+ - NAME: "Browser tests: slim build, Chrome"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:slim"
BROWSERS: "ChromeHeadless"
- - NAME: "Browser tests: no-deprecated build, Chrome stable"
- NODE_VERSION: "16.x"
+ - NAME: "Browser tests: no-deprecated build, Chrome"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:no-deprecated"
BROWSERS: "ChromeHeadless"
- - NAME: "Browser tests: selector-native build, Chrome stable"
- NODE_VERSION: "16.x"
+ - NAME: "Browser tests: selector-native build, Chrome"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:selector-native"
BROWSERS: "ChromeHeadless"
- NAME: "Browser tests: AMD build, Chrome stable"
- NODE_VERSION: "16.x"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:amd"
BROWSERS: "ChromeHeadless"
- NAME: "Browser tests: full build, Firefox ESR"
- NODE_VERSION: "16.x"
+ NODE_VERSION: "18.x"
NPM_SCRIPT: "test:browser"
BROWSERS: "FirefoxHeadless"
steps:
@@ -67,6 +67,10 @@ jobs:
run: |
npm install
+ - name: Install Playwright dependencies
+ run: npx playwright-webkit install-deps
+ if: "matrix.NPM_SCRIPT == 'test:browser'"
+
- name: Run tests
env:
BROWSERS: ${{ matrix.BROWSERS }}