-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.46 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
name: Playwright Tests
# Trigger workflow on push, pull request, or on a schedule (every hour)
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 */15 * * *" # Run every 15 hours
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16] # Specify Node.js version
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Install Playwright with dependencies
run: npx playwright install --with-deps
- name: Run Playwright tests
run: |
yarn playwright test --reporter=dot,junit
timeout-minutes: 120 # Set timeout to 2 hours
- name: Upload Playwright reports
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report
- name: Upload JUnit test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: test_results.xml