Skip to content

Commit 14d007a

Browse files
cursoragentlovasoa
andcommitted
Add cross-browser load tests
Co-authored-by: contact <contact@ophir.dev>
1 parent 47504ce commit 14d007a

4 files changed

Lines changed: 3824 additions & 147 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ jobs:
1818
run: npm ci
1919
- name: Build extension
2020
run: npm run build
21+
- name: Download Firefox Nightly
22+
if: matrix.name == 'firefox'
23+
run: |
24+
NIGHTLY_NAME=$(curl -sL https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ | rg -o "firefox-[0-9.]+a1.en-US.linux-x86_64.tar.xz" | head -n 1)
25+
curl -sL "https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/${NIGHTLY_NAME}" -o /tmp/firefox-nightly.tar.xz
26+
tar -xf /tmp/firefox-nightly.tar.xz -C /tmp
27+
echo "FIREFOX_BIN=/tmp/firefox/firefox" >> $GITHUB_ENV
2128
- name: TypeScript checks
2229
run: npm run test:types
2330
- uses: actions/upload-artifact@v4
@@ -29,7 +36,15 @@ jobs:
2936
runs-on: ubuntu-latest
3037
strategy:
3138
matrix:
32-
browser: [firefox, chrome]
39+
include:
40+
- name: firefox
41+
playwright: firefox
42+
script: firefox
43+
load: firefox
44+
- name: chrome
45+
playwright: chromium
46+
script: chrome
47+
load: chromium
3348
steps:
3449
- uses: actions/checkout@v4
3550
- name: Use Node.js 20.x
@@ -41,5 +56,9 @@ jobs:
4156
run: npm ci
4257
- name: Build extension
4358
run: npm run build
44-
- name: Test on ${{ matrix.browser }}
45-
run: npm run test:${{ matrix.browser }}
59+
- name: Install Playwright browsers
60+
run: npx playwright install --with-deps ${{ matrix.playwright }}
61+
- name: Lint on ${{ matrix.name }}
62+
run: npm run test:${{ matrix.script }}
63+
- name: Load extension on ${{ matrix.name }}
64+
run: xvfb-run -a npm run test:load:${{ matrix.load }}

0 commit comments

Comments
 (0)