Repository navigation
134 lines (106 loc) · 4 KB
/
Copy pathplaywright.yml
File metadata and controls
134 lines (106 loc) · 4 KB
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
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Playwright
on: pull_request
concurrency:
group: playwright-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
env:
APP_NAME: ${{ github.event.repository.name }}
BRANCH: ${{ github.base_ref || github.ref_name }}
jobs:
playwright:
runs-on: ubuntu-latest
name: Playwright E2E tests
steps:
- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^24'
fallbackNpm: '^11'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
- name: Build app
run: TESTING=true npm run build --if-present
- name: Run Playwright tests
run: npx playwright test
env:
BRANCH: ${{ env.BRANCH }}
CI: true
- name: Show Nextcloud logs on failure
if: failure()
run: |
docker exec nextcloud-e2e-test-server_activity cat data/nextcloud.log || true
- name: Upload blob report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ !cancelled() }}
with:
name: blob-report
path: blob-report/
retention-days: 1
- name: Upload Playwright traces
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: failure()
with:
name: playwright-traces
path: test-results/
retention-days: 7
merge-reports:
if: ${{ !cancelled() }}
needs: playwright
runs-on: ubuntu-latest
steps:
- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^24'
fallbackNpm: '^11'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g 'npm@${{ needs.playwright.outputs.npmVersion }}'
- name: Install dependencies
run: npm ci
- name: Download blob report
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: blob-report
path: blob-report
- name: Merge into HTML report
run: npx playwright merge-reports --reporter html ./blob-report
- name: Upload HTML report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report/
retention-days: 7
summary:
runs-on: ubuntu-latest-low
needs: playwright
if: always()
name: playwright-summary
steps:
- name: Summary status
run: if ${{ needs.playwright.result != 'success' && needs.playwright.result != 'skipped' }}; then exit 1; fi