Skip to content

Commit 63eee93

Browse files
committed
Build: Improve actions setup for PRs
Improve the actions setup for PRs so that more issues are detected pre-merge. Changes: 1. Test on Edge in IE mode 2. Test on more jQuery versions: `git`, `3.x-git`, `3.7.1` & their slim versions as well as full versions of each `3.x` jQuery minor. This is still fewer tests than post-merge: we don't test all slim versions and Migrate dev, but this should cover the majority of cases.
1 parent 77e2245 commit 63eee93

File tree

4 files changed

+141
-71
lines changed

4 files changed

+141
-71
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Browsers - local
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
NODE_VERSION: 20.x
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
name: ${{ matrix.MIGRATE_VERSION }} (Chrome/Firefox)
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
MIGRATE_VERSION: ["min"]
17+
include:
18+
- MIGRATE_VERSION: "esmodules"
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
22+
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Cache
29+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
30+
with:
31+
path: ~/.npm
32+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
35+
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Run tests
40+
run: |
41+
npm run test:browser -- \
42+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} \
43+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
44+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
45+
--jquery 3.7.1 --jquery 3.7.1.slim \
46+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
47+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
48+
--retries 3 --hard-retries 1
49+
50+
ie:
51+
runs-on: windows-latest
52+
name: ${{ matrix.MIGRATE_VERSION }} (Edge in IE mode)
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
MIGRATE_VERSION: [ "min" ]
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
60+
61+
- name: Use Node.js ${{ env.NODE_VERSION }}
62+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
63+
with:
64+
node-version: ${{ env.NODE_VERSION }}
65+
66+
- name: Cache
67+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
68+
with:
69+
path: ~/.npm
70+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
71+
restore-keys: |
72+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
73+
74+
- name: Install dependencies
75+
run: npm install
76+
77+
- name: Run tests
78+
run: |
79+
npm run test:ie --% ^
80+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} ^
81+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min ^
82+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min ^
83+
--jquery 3.7.1 --jquery 3.7.1.slim ^
84+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 ^
85+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 ^
86+
--retries 3 --hard-retries 1
87+
88+
safari:
89+
runs-on: macos-latest
90+
name: ${{ matrix.MIGRATE_VERSION }} (Safari)
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
MIGRATE_VERSION: ["min"]
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
98+
99+
- name: Use Node.js ${{ env.NODE_VERSION }}
100+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
101+
with:
102+
node-version: ${{ env.NODE_VERSION }}
103+
104+
- name: Cache
105+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
106+
with:
107+
path: ~/.npm
108+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
109+
restore-keys: |
110+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
111+
112+
- name: Install dependencies
113+
run: npm install
114+
115+
- name: Run tests
116+
run: |
117+
npm run test:safari -- \
118+
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} \
119+
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
120+
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
121+
--jquery 3.7.1 --jquery 3.7.1.slim \
122+
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
123+
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
124+
--retries 3 --hard-retries 1

.github/workflows/node.js.yml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -34,71 +34,3 @@ jobs:
3434

3535
- name: Run Node smoke tests
3636
run: npm run test:node_smoke_tests
37-
38-
test:
39-
runs-on: ubuntu-latest
40-
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Chrome/Firefox)
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
MIGRATE_VERSION: ["min"]
45-
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
46-
include:
47-
- MIGRATE_VERSION: "esmodules"
48-
JQUERY_VERSION: "3.x-git.slim.min"
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
52-
53-
- name: Use Node.js ${{ env.NODE_VERSION }}
54-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
55-
with:
56-
node-version: ${{ env.NODE_VERSION }}
57-
58-
- name: Cache
59-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
60-
with:
61-
path: ~/.npm
62-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
63-
restore-keys: |
64-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
65-
66-
- name: Install dependencies
67-
run: npm install
68-
69-
- name: Run tests
70-
run: npm run test:browser -- --jquery-migrate=${{ matrix.MIGRATE_VERSION }} --jquery=${{ matrix.JQUERY_VERSION }}
71-
72-
safari:
73-
runs-on: macos-latest
74-
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Safari)
75-
strategy:
76-
fail-fast: false
77-
matrix:
78-
MIGRATE_VERSION: ["min"]
79-
JQUERY_VERSION: ["git.min", "git.slim.min", "3.x-git.min", "3.x-git.slim.min"]
80-
steps:
81-
- name: Checkout
82-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
83-
84-
- name: Use Node.js ${{ env.NODE_VERSION }}
85-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
86-
with:
87-
node-version: ${{ env.NODE_VERSION }}
88-
89-
- name: Cache
90-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
91-
with:
92-
path: ~/.npm
93-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
94-
restore-keys: |
95-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
96-
97-
- name: Install dependencies
98-
run: npm install
99-
100-
- name: Run tests
101-
run: |
102-
npm run test:safari -- \
103-
--jquery-migrate=${{ matrix.MIGRATE_VERSION }} \
104-
--jquery=${{ matrix.JQUERY_VERSION }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"pretest": "npm run npmcopy && npm run build && npm run lint",
2727
"start": "npm run npmcopy && node build/tasks/build-watch.js",
2828
"test:browser": "npm run pretest && npm run test:unit -- -b chrome -b firefox -h",
29+
"test:ie": "npm run pretest && npm run test:unit -- -v -b ie",
2930
"test:node_smoke_tests": "npm run pretest && node test/node_smoke_tests/smoke_tests.cjs",
3031
"test:safari": "npm run pretest && npm run test:unit -- -v -b safari",
3132
"test:server": "node test/runner/server.js",

test/runner/selenium/createDriver.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@ import { Builder, Capabilities, logging } from "selenium-webdriver";
22
import Chrome from "selenium-webdriver/chrome.js";
33
import Edge from "selenium-webdriver/edge.js";
44
import Firefox from "selenium-webdriver/firefox.js";
5+
import IE from "selenium-webdriver/ie.js";
56
import { browserSupportsHeadless } from "../lib/getBrowserString.js";
67

78
// Set script timeout to 10min
89
const DRIVER_SCRIPT_TIMEOUT = 1000 * 60 * 10;
910

1011
export default async function createDriver( { browserName, headless, url, verbose } ) {
1112
const capabilities = Capabilities[ browserName ]();
12-
const prefs = new logging.Preferences();
13-
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
14-
capabilities.setLoggingPrefs( prefs );
13+
14+
// Support: IE 11+
15+
// When those are set for IE, the process crashes with an error:
16+
// "Unable to match capability set 0: goog:loggingPrefs is an unknown
17+
// extension capability for IE".
18+
if ( browserName !== "ie" ) {
19+
const prefs = new logging.Preferences();
20+
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
21+
capabilities.setLoggingPrefs( prefs );
22+
}
1523

1624
let driver = new Builder().withCapabilities( capabilities );
1725

@@ -49,6 +57,10 @@ export default async function createDriver( { browserName, headless, url, verbos
4957
edgeOptions.setEdgeChromiumBinaryPath( process.env.EDGE_BIN );
5058
}
5159

60+
const ieOptions = new IE.Options();
61+
ieOptions.setEdgeChromium( true );
62+
ieOptions.setEdgePath( "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" );
63+
5264
if ( headless ) {
5365
chromeOptions.addArguments( "--headless=new" );
5466
firefoxOptions.addArguments( "--headless" );
@@ -65,6 +77,7 @@ export default async function createDriver( { browserName, headless, url, verbos
6577
.setChromeOptions( chromeOptions )
6678
.setFirefoxOptions( firefoxOptions )
6779
.setEdgeOptions( edgeOptions )
80+
.setIeOptions( ieOptions )
6881
.build();
6982

7083
if ( verbose ) {

0 commit comments

Comments
 (0)