Skip to content

Commit 34a73c1

Browse files
test: add automation
1 parent 0493b72 commit 34a73c1

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test on PR branch
2+
on: pull_request
3+
4+
jobs:
5+
test-on-pr-branch:
6+
runs-on: ubuntu-20.04
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
11+
- name: Set up Node.js
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: '20'
15+
16+
- name: Install dependencies
17+
run: npm ci
18+
19+
- name: Install playwright browsers
20+
run: npx playwright install --with-deps
21+
22+
- name: Run tests
23+
run: npm run test

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Set up Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: '20'
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Install playwright browsers
21+
run: npx playwright install --with-deps
22+
23+
- name: Run tests
24+
run: npm run test
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update Screenshots
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Set up Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: '20'
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Install playwright browsers
21+
run: npx playwright install --with-deps
22+
23+
- name: Run tests
24+
run: npm run test
25+
26+
- name: Update screenshots
27+
if: failure()
28+
run: npm run test:update
29+
30+
- name: Upload failed screenshots as artifacts
31+
uses: actions/upload-artifact@v4
32+
if: failure()
33+
with:
34+
name: failed_screenshots
35+
path: |
36+
screenshots/*/failed/
37+
screenshots/*/baseline/

0 commit comments

Comments
 (0)