Skip to content

Commit 4cc2d5a

Browse files
authored
Add testing infrastructure and basic Webdriver tests (#104)
1 parent 752b748 commit 4cc2d5a

File tree

8 files changed

+5592
-1
lines changed

8 files changed

+5592
-1
lines changed

.github/workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
firefox-version: [latest-nightly, latest-devedition]
17+
fail-fast: false
18+
19+
name: test (firefox-${{ matrix.firefox-version }})
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
cache: 'npm'
30+
31+
- name: Cache Firefox
32+
id: cache-firefox
33+
uses: actions/cache@v4
34+
with:
35+
path: /opt/hostedtoolcache/firefox/${{ matrix.firefox-version }}
36+
key: firefox-${{ matrix.firefox-version }}-${{ runner.os }}
37+
38+
- name: Set up Firefox ${{ matrix.firefox-version }}
39+
if: steps.cache-firefox.outputs.cache-hit != 'true'
40+
uses: browser-actions/setup-firefox@v1
41+
with:
42+
firefox-version: ${{ matrix.firefox-version }}
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Run tests
48+
run: xvfb-run --auto-servernum npm test
49+
env:
50+
FIREFOX_BINARY: /opt/hostedtoolcache/firefox/${{ matrix.firefox-version }}/x64/firefox
51+
DISPLAY: :99
52+
53+
- name: Upload screenshots on failure
54+
if: failure()
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: test-screenshots-${{ matrix.firefox-version }}
58+
path: test/screenshots/
59+
if-no-files-found: ignore

0 commit comments

Comments
 (0)