-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (116 loc) · 4.02 KB
/
playwright-matrix.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Playwright Tests
on:
pull_request:
paths-ignore:
- ".github/workflows/**"
workflow_dispatch:
jobs:
test:
runs-on: macos-14
strategy:
matrix:
project: [desktop-chrome, mobile-chrome, mobile-safari]
steps:
- name: Checkout Uplink Web directory
uses: actions/checkout@v4
with:
repository: Satellite-im/UplinkWeb
- name: Checkout Automated Tests directory
uses: actions/checkout@v4
with:
path: automated-tests
- name: Setup Node.js for Uplink Web
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies for Uplink Web
run: npm install
- name: Install dependencies for Testing Repo
working-directory: automated-tests
run: npm install
- name: Install Playwright Browsers
working-directory: automated-tests
run: npx playwright install --with-deps
- name: Run server for Uplink Web
run: npm run dev &
- name: Run Playwright tests for Desktop
if: matrix.project == 'desktop-chrome'
working-directory: automated-tests
run: |
PLAYWRIGHT_JSON_OUTPUT_NAME=report.json npx playwright test --project=${{ matrix.project }}
- name: Run Playwright tests for Mobile Chrome and Safari (Single Test File)
if: matrix.project == 'mobile-chrome' || matrix.project == 'mobile-safari'
working-directory: automated-tests
run: |
PLAYWRIGHT_JSON_OUTPUT_NAME=report.json npx playwright test ./automated-tests/playwright/specs/07-settings-profile.spec.ts --project=${{ matrix.project }}
- name: Upload Playwright report
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.project }}
path: automated-tests/playwright-report/
- name: Upload Allure results
uses: actions/upload-artifact@v4
with:
name: allure-results-${{ matrix.project }}
path: automated-tests/allure-results/
- name: Add label if any of build jobs failed
if: failure()
uses: buildsville/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Failed Automated Test
type: add
merge-reports:
runs-on: ubuntu-latest
needs: test
steps:
- name: Download Playwright reports
uses: actions/download-artifact@v4
with:
name: playwright-report-*
path: ./playwright-reports/
- name: Download Allure results
uses: actions/download-artifact@v4
with:
name: allure-results-*
path: ./allure-results/
- name: Generate Allure report
run: |
npx allure generate ./allure-results --clean -o allure-report
- name: Generate Playwright HTML report
run: |
npx playwright show-report ./playwright-reports
- name: Upload Allure report to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: allure-report
- name: Comment PR with Test Results Summary
if: github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v2
with:
message: |
Playwright test execution is complete!
- Playwright report: [here](https://github.io/playwright-report)
- Allure report: [here](https://your-gh-pages-url)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
finalize-label:
needs: [test, merge-reports]
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
issues: read
steps:
- name: Remove label if all tests succeeded
if: success()
uses: buildsville/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Failed Automated Test
type: remove