how to migrate from cypress to playwright incrementally
Outlines an incremental migration from Cypress to Playwright: run both side by side, migrate new and high-value tests first, keep CI green throughout. Use when moving suites without a big-bang rewrite. Not for starting fresh with Playwright.
TL;DR
Migrate incrementally, not in one big rewrite. Run Cypress and Playwright side by side in CI, write all new tests in Playwright, and migrate existing suites one at a time starting with the most valuable or most flaky. Build a thin helper layer (login, seeding, common assertions) in Playwright first so migrated tests read naturally instead of being line-for-line Cypress translations. Delete the Cypress version of a suite only after its Playwright replacement is green for a few weeks.
The query
how to migrate from cypress to playwright incrementallyUse this when
- Moving an existing Cypress suite to Playwright.
- You cannot afford a testing freeze during migration.
Not for
- Greenfield Playwright projects.
- Migrating away from Playwright.
Steps
- Set up Playwright alongside Cypress in CI with its own job. Expected output: both frameworks run, CI stays green.
- Build shared Playwright helpers: login, data seeding, custom assertions. Expected output: a small helper library new tests use.
- Write all new tests in Playwright; stop adding to the Cypress suite. Expected output: the Cypress suite stops growing.
- Migrate suites one at a time, most valuable first, and run both versions in parallel for two weeks. Expected output: each migrated suite is proven before the old one is deleted.
- Delete migrated Cypress specs and, at the end, the Cypress setup itself. Expected output: one framework, no leftovers.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_jSMkDt6nSq9Zz9XkVf5iKQ
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.