Skip to content

[stable34] refactor(tests): migrate e2e test suite from Cypress to Playwright#2633

Draft
backportbot[bot] wants to merge 6 commits into
stable34from
backport/2603/stable34
Draft

[stable34] refactor(tests): migrate e2e test suite from Cypress to Playwright#2633
backportbot[bot] wants to merge 6 commits into
stable34from
backport/2603/stable34

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented Jun 1, 2026

Backport of #2603

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Screenshots are being rebuilt centrally in the nextcloud/documentation repo
for the entire NC suite.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers the activity stream page (entry rendering, heading/filter
navigation, RSS feed toggle) and the admin settings page (email
enable toggle visibility, default settings grid, and persistence
across page reloads).

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the `url:` health-check with `wait: { stdout: /Nextcloud ready at/ }`
so Playwright waits for the explicit ready signal from start-server.mjs
rather than polling the HTTP port, which can respond before Nextcloud
finishes booting and cause flaky test starts.

Also adds gracefulShutdown so the start-server process is cleanly
terminated when Playwright exits.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump @playwright/test 1.49 → 1.60
- Enable fullyParallel, reduce CI retries to 1, keep workers: 1 (single
  container SQLite can't safely handle concurrent test sessions)
- Switch CI reporter to blob+dot+github; add merge-reports job so
  failed runs produce a downloadable HTML report
- Add SIGTERM/SIGINT handlers to start-server.mjs to cleanly stop the
  container in CI; locally the container is left running for reuse
- Add Nextcloud log dump step on CI failure

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(playwright): apply server optimizations from nextcloud/server

- Disable the app store to prevent external requests during tests

- Enable SQLite WAL mode with busyTimeout(5000) for better concurrency

- Initialize cron upfront so background jobs are seeded before tests run

Workers stays at 1: even with WAL mode, concurrent sessions for the

same admin user cause Nextcloud-level 500s, so parallelism isn't safe

with this container setup.

Signed-off-by: Anna Larch <anna@nextcloud.com>

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>

[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant