-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (73 loc) · 2.12 KB
/
playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
generate-test-run-id:
name: Generate Test Run ID
runs-on: ubuntu-latest
steps:
- run: yarn add uuid
shell: sh
- uses: actions/github-script@v6
id: uuid
with:
result-encoding: string
script: return require("uuid").v4()
outputs:
testRunId: ${{ steps.uuid.outputs.result }}
preview-branch:
name: Wait for Vercel Preview Branch
runs-on: ubuntu-latest
steps:
- name: Waiting for 200 from the Vercel Preview
uses: patrickedqvist/[email protected]
id: waitFor200
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 960
check_interval: 60
environment: ${{ fromJSON('["", "production"]')[github.ref == 'refs/heads/main'] }}
outputs:
url: ${{ steps.waitFor200.outputs.url }}
e2e-test:
name: Playwright e2e tests
needs: [preview-branch]
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm test:e2e
env:
NEXT_PUBLIC_APP_URL: ${{ needs.preview-branch.outputs.url }}
RECORD_REPLAY_TEST_RUN_ID: ${{ needs.generate-test-run-id.outputs.testRunId }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "16"
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Run tests
run: pnpm test