Skip to content

Commit f2e1e9a

Browse files
committed
refactor(tests): migrate e2e test suite from Cypress to Playwright
Replaces the Cypress setup with @playwright/test + @nextcloud/e2e-test-server. All 9 existing tests pass locally. The comment activity test remains skipped pending a fix to the comments app (pre-existing skip from the Cypress suite). Key changes: - Add playwright.config.ts with managed Docker server via start-server.mjs - Rewrite e2e helpers (filesUtils, sidebarUtils) using Playwright APIs - Fix: replace CSS.escape() (browser-only API) with a Node-safe cssEscape() - Fix: hover file row before clicking Actions to ensure dropdown opens - Fix: skip disabled checkboxes in settings test (email disabled without SMTP) - Fix: use numeric values for frequency select assertions (Weekly=2, Hourly=0) - Add GitHub Actions workflow (playwright.yml), remove cypress.yml - Remove all Cypress dependencies and config files Signed-off-by: Anna Larch <anna@larch.dev> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 29d896c commit f2e1e9a

26 files changed

Lines changed: 807 additions & 4063 deletions

.github/workflows/cypress.yml

Lines changed: 0 additions & 169 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Playwright
5+
6+
on: pull_request
7+
8+
concurrency:
9+
group: playwright-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
env:
16+
APP_NAME: ${{ github.event.repository.name }}
17+
BRANCH: ${{ github.base_ref || github.ref_name }}
18+
19+
jobs:
20+
playwright:
21+
runs-on: ubuntu-latest
22+
23+
name: Playwright E2E tests
24+
25+
steps:
26+
- name: Checkout app
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
30+
31+
- name: Read package.json node and npm engines version
32+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
33+
id: versions
34+
with:
35+
fallbackNode: '^24'
36+
fallbackNpm: '^11'
37+
38+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
39+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
40+
with:
41+
node-version: ${{ steps.versions.outputs.nodeVersion }}
42+
43+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
44+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
45+
46+
- name: Install dependencies
47+
run: npm ci
48+
49+
- name: Install Playwright browsers
50+
run: npx playwright install chromium --with-deps
51+
52+
- name: Build app
53+
run: TESTING=true npm run build --if-present
54+
55+
- name: Run Playwright tests
56+
run: npx playwright test
57+
env:
58+
BRANCH: ${{ env.BRANCH }}
59+
CI: true
60+
61+
- name: Upload Playwright report
62+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
63+
if: always()
64+
with:
65+
name: playwright-report
66+
path: playwright-report/
67+
retention-days: 30
68+
69+
- name: Upload Playwright traces
70+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
71+
if: failure()
72+
with:
73+
name: playwright-traces
74+
path: test-results/
75+
retention-days: 7
76+
77+
summary:
78+
runs-on: ubuntu-latest-low
79+
needs: playwright
80+
if: always()
81+
name: playwright-summary
82+
steps:
83+
- name: Summary status
84+
run: if ${{ needs.playwright.result != 'success' && needs.playwright.result != 'skipped' }}; then exit 1; fi

cypress.config.ts

Lines changed: 0 additions & 108 deletions
This file was deleted.

cypress/.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

cypress/.eslintrc.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

cypress/component/ComponentName.cy.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)