-
Notifications
You must be signed in to change notification settings - Fork 1.4k
104 lines (85 loc) · 2.8 KB
/
playwright_tests.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Playwright Tests
on:
push:
branches: [ "V2" ]
paths-ignore:
- "**.md"
pull_request:
branches: [ "V2" ]
paths-ignore:
- "**.md"
concurrency:
# Support push/pr as event types with different behaviors each:
# 1. push: queue up builds
# 2. pr: only allow one run per PR
group: ${{ github.workflow }}-${{ github.event.type }}${{ github.event.pull_request.number }}
# If there is already a workflow running for the same pull request, cancel it
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
jobs:
e2e_tests:
name: 'Playwright Tests - ${{ matrix.project }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [chromium, firefox]
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install deps
run: npm ci
- name: build
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium firefox
- name: Run Playwright tests
working-directory: ./laboratory
run: npx playwright test --project=${{ matrix.project }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-${{ matrix.project }}
path: ./laboratory/playwright-report/
retention-days: 7
e2e_injected_tests:
name: 'Playwright Injected Wallet Tests'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: unzip extension data
working-directory: ./laboratory/tests/shared/data
run: |
7z x metamask-chrome-10.34.0.7z
7z x mm-storage.7z
- name: Install deps
run: npm ci
- name: build
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
working-directory: ./laboratory
run: npx playwright test --project=injected
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-injected
path: ./laboratory/playwright-report/
retention-days: 7