Skip to content

Commit a534ab7

Browse files
authored
Merge pull request #559 from nextcloud/backport/558/stable30
[stable30] Add playwright skeleton for e2e tests
2 parents 6e144cd + e0e55a0 commit a534ab7

9 files changed

+812
-31
lines changed

.github/workflows/playwright.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
name: Playwright Tests
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
timeout-minutes: 60
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout app
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Check composer.json
17+
id: check_composer
18+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
19+
with:
20+
files: 'composer.json'
21+
22+
- name: Install composer dependencies
23+
if: steps.check_composer.outputs.files_exists == 'true'
24+
run: composer install --no-dev
25+
26+
- name: Read package.json node and npm engines version
27+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
28+
id: versions
29+
with:
30+
fallbackNode: '^20'
31+
fallbackNpm: '^10'
32+
33+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
34+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
35+
with:
36+
node-version: ${{ steps.versions.outputs.nodeVersion }}
37+
38+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
39+
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
40+
41+
- name: Install node dependencies & build app
42+
run: |
43+
npm ci
44+
TESTING=true npm run build --if-present
45+
46+
- name: Install Playwright Browsers
47+
run: npx playwright install chromium --only-shell
48+
49+
- name: Run Playwright tests
50+
run: npx playwright test
51+
52+
- uses: actions/upload-artifact@v4
53+
if: always()
54+
with:
55+
name: playwright-report
56+
path: playwright-report/
57+
retention-days: 30

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/js/
88
/vendor/
99
/node_modules/
10+
/playwright-report/
1011

1112
.php-cs-fixer.cache
1213
.phpunit.result.cache

0 commit comments

Comments
 (0)