Migrate errorPage404 to Playwright with CI setup#14064
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Playwright E2E coverage for the errorPage404 page type in the ws-nextjs-app, along with CI automation to run the new Playwright suite on pull requests.
Changes:
- Added Playwright (
@playwright/test) tows-nextjs-appand committed updated lockfile entries. - Introduced Playwright config, documentation, and a new
errorPage404Playwright test suite + suite definitions. - Added a GitHub Actions workflow to build/start the Next.js app and execute the Playwright page-type tests on PRs.
Reviewed changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds Playwright-related dependencies to the workspace lockfile. |
| ws-nextjs-app/test-results/.last-run.json | Adds Playwright run output artifact (currently committed). |
| ws-nextjs-app/playwright/README.md | Documents how to run/debug Playwright E2Es for the Next.js app. |
| ws-nextjs-app/playwright/pageTypes/errorPage404/suites.ts | Defines canonical/AMP suite inputs for errorPage404 tests. |
| ws-nextjs-app/playwright/pageTypes/errorPage404/errorPage404.spec.ts | Implements Playwright E2E assertions for errorPage404. |
| ws-nextjs-app/playwright.config.ts | Adds Playwright runner configuration (baseURL/env selection, retries, reporter). |
| ws-nextjs-app/package.json | Adds Playwright scripts and @playwright/test dev dependency. |
| .github/workflows/simorgh-e2e-playwright-page-types.yml | New CI workflow to run Playwright page-type E2Es in PRs. |
c66f168 to
885db83
Compare
e6b2f09 to
885db83
Compare
885db83 to
abf24b0
Compare
| test.describe('errorPage404', () => { | ||
| const allSuites = [ | ||
| ...errorPage404Suites.canonical, | ||
| ...errorPage404Suites.amp, |
There was a problem hiding this comment.
should this include lite too? If cypress didn't have it, it maybe doesn't need to be in this PR
andrewscfc
left a comment
There was a problem hiding this comment.
Looks good, I did think as I read that for error page tests the same could probably be achieved just with integration tests?
I remember certainly with Cypress you only truly need them when a test relies and clientside JS behaviour, e.g. lazy loading of resources or mult-step journeys (e.g. cookie banner, login etc)
I guess the gap with integration tests is I don't think they can run against deployed environments atm?
Resolves JIRA: WS-2715
Summary
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
playwright.config.ts.errorPage404.spec.ts.simorgh-e2e-playwright-page-types.yml.README.md.Testing
Useful Links