-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (154 loc) Β· 5.16 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Playwright Tests
on:
schedule:
- cron: "0 0/6 * * 1-5"
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- ".gitignore"
- ".prettierignore"
- ".prettierrc.json"
- "PULL_REQUEST_TEMPLATE.md"
- "README.md"
workflow_dispatch:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.47.2-jammy
strategy:
fail-fast: false
matrix:
project: ["desktop-chrome", "mobile-chrome"]
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 ci
- name: Install Allure Commandline
run: npm install -g allure-commandline
- name: Run Playwright tests
working-directory: automated-tests
run: npx playwright test -c playwright.ci.config.ts --project=${{ matrix.project }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.project }}
path: automated-tests/playwright-report/
retention-days: 5
- name: Upload Allure results as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-${{ matrix.project }}
path: automated-tests/allure-results
retention-days: 5
- 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
generate-report:
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- name: Download Allure results artifact for desktop
uses: actions/download-artifact@v4
with:
name: allure-results-desktop-chrome
path: automated-tests/allure/desktop-chrome
- name: Download Allure results artifact for mobile
uses: actions/download-artifact@v4
with:
name: allure-results-mobile-chrome
path: automated-tests/allure/mobile-chrome
- name: Merge Allure results
run: |
mkdir -p automated-tests/allure-results
cp -r automated-tests/allure/desktop-chrome/* automated-tests/allure-results/
cp -r automated-tests/allure/mobile-chrome/* automated-tests/allure-results/
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
repository: Satellite-im/test-reports
ref: gh-pages
path: gh-pages
- name: Generate Allure Report
if: always()
uses: simple-elf/allure-report-action@master
with:
gh_pages: gh-pages
allure_results: automated-tests/allure-results
allure_report: allure-report
allure_history: allure-history
keep_reports: 100
- name: Deploy report to Github Pages
if: success()
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: Satellite-im/test-reports
publish_branch: gh-pages
publish_dir: allure-history
- name: Comment PR with Allure test results
if: always() && github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v2
with:
message: |
Playwright test execution is complete! You can find the test results report [here](https://satellite-im.github.io/test-reports/${{ github.run_number }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
remove-label:
needs: [test, generate-report]
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
issues: read
steps:
- name: Checkout directory π
uses: actions/checkout@v4
- name: Delete artifacts required on failed execution
uses: geekyeggo/delete-artifact@v5
with:
name: |
playwright-report-desktop-chrome
playwright-report-mobile-chrome
allure-results-desktop-chrome
allure-results-mobile-chrome
- name: Remove label if all test jobs succeeded
uses: buildsville/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Failed Automated Test
type: remove