Replace Cypress with Playwright in samples/headless-ssr/search-nextjs#7245
Replace Cypress with Playwright in samples/headless-ssr/search-nextjs#7245
Conversation
…nextjs Co-authored-by: louis-bompart <12366410+louis-bompart@users.noreply.github.com>
…tests Co-authored-by: louis-bompart <12366410+louis-bompart@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the samples/headless-ssr/search-nextjs sample’s end-to-end coverage from Cypress to Playwright and wires the new Playwright run into the repository CI workflow.
Changes:
- Replaced Cypress E2E setup/tests with Playwright configuration, fixtures, and specs for the NextJS SSR Search sample.
- Updated the sample’s
package.jsonscripts/devDependencies and.gitignoreto reflect Playwright usage. - Updated CI to run the new Playwright composite action instead of the Cypress one.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
samples/headless-ssr/search-nextjs/playwright.config.ts |
Adds Playwright test runner config and webServer startup for the sample. |
samples/headless-ssr/search-nextjs/package.json |
Switches E2E scripts from Cypress to Playwright and updates devDependencies. |
samples/headless-ssr/search-nextjs/e2e/search.fixture.ts |
Introduces shared Playwright helpers/selectors and SSR response parsing helper. |
samples/headless-ssr/search-nextjs/e2e/smoke.spec.ts |
Adds Playwright smoke coverage for SSR/CSR rendering and hydration behavior. |
samples/headless-ssr/search-nextjs/e2e/ssr-search-parameter-manager.spec.ts |
Adds Playwright coverage for search parameter manager / history behaviors. |
samples/headless-ssr/search-nextjs/.gitignore |
Removes Cypress artifact ignores and adds Playwright report/test artifact ignores. |
samples/headless-ssr/search-nextjs/cypress.config.ts |
Removes Cypress configuration. |
samples/headless-ssr/search-nextjs/cypress/e2e/utils.ts |
Removes Cypress test utilities. |
samples/headless-ssr/search-nextjs/cypress/e2e/smoke.cy.ts |
Removes Cypress smoke tests (including vitals audit). |
samples/headless-ssr/search-nextjs/cypress/e2e/ssr-search-parameter-manager.cy.ts |
Removes Cypress parameter manager tests. |
.github/workflows/ci.yml |
Replaces the Cypress SSR Search NextJS job/action with a Playwright-based job in a Playwright container. |
.github/actions/playwright-headless-ssr-search-nextjs/action.yml |
Adds composite action to run the sample’s Playwright tests. |
.github/actions/cypress-headless-ssr-search-nextjs/action.yml |
Removes composite action previously used to run Cypress tests. |
pnpm-lock.yaml |
Updates lockfile for dependency changes and introduces an additional Playwright resolution. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| timeout: 7 * 1000, | ||
| }, | ||
| webServer: { | ||
| command: 'npm run prod', |
| '@vitest/browser-playwright@4.0.10(msw@2.11.4(@types/node@25.0.10)(typescript@5.9.3))(playwright@1.58.0-alpha-1763757971000)(vite@7.2.2(@types/node@25.0.10)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.1)(sass@1.97.3)(terser@5.46.0)(yaml@2.8.2))(vitest@4.0.10)': | ||
| dependencies: | ||
| '@vitest/browser': 4.0.10(msw@2.11.4(@types/node@25.0.10)(typescript@5.9.3))(vite@7.2.2(@types/node@25.0.10)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.1)(sass@1.97.3)(terser@5.46.0)(yaml@2.8.2))(vitest@4.0.10) | ||
| '@vitest/mocker': 4.0.10(msw@2.11.4(@types/node@25.0.10)(typescript@5.9.3))(vite@7.2.2(@types/node@25.0.10)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.1)(sass@1.97.3)(terser@5.46.0)(yaml@2.8.2)) | ||
| playwright: 1.56.1 | ||
| playwright: 1.58.0-alpha-1763757971000 | ||
| tinyrainbow: 3.0.3 |
| } | ||
|
|
||
| async function getResultTitles(page: Page) { | ||
| const items = page.locator('.result-list li'); |
|
Hey @copilot-swe-agent 👋 ✅ This PR does not need a changeset file — you don't have one currently, so it's perfect. This PR only migrates tests in a sample app (Cypress → Playwright), which doesn't affect any published packages. For more info on when changesets are needed, see the Changesets README. |
|
@copilot resolve the merge conflicts in this pull request |
…ss-with-playwright-another-one # Conflicts: # .github/actions/cypress-headless-ssr-search-nextjs/action.yml # .github/workflows/ci.yml # pnpm-lock.yaml # samples/headless-ssr/search-nextjs/package.json
|
Resolved the merge conflicts in commit |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
samples/headless-ssr/search-nextjsplaywright.config.ts, e2e test files, and shared fixturespackage.jsondependencies and scripts.gitignorefor Playwrightci.ymlresultListSelectorconstant, replacewaitForTimeout)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.