October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How I Migrated 90 Cypress Tests to Playwright With Claude Code in 4 Days

A four-day migration account offers a practical lesson: teach the agent project-specific behavior, work in reviewable batches, and verify more than green tests.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DEV Community author yureki_lab says they migrated a 90-spec Cypress suite to Playwright in four working days with Claude Code. The useful lesson is not that an AI agent can guarantee a four-day migration; it is how the author constrained its guesses: translate one representative test by hand, turn the decisions into explicit rules, migrate small batches, then check test meaning and rendered output—not just whether the suite turns green.

The starting point: a large suite with real maintenance costs

In the author’s account, the Cypress suite contained 90 specs written over three years by six people. It took about 38 minutes on CI and had a flake roughly once every four runs. These are the author’s descriptions of one project, not independently audited baseline measurements.

As an Amazon Associate I earn from qualifying purchases.

The migration was motivated by project needs, including multi-tab testing and parallel execution. Those reasons explain this team’s choice; they do not establish that Playwright is the right replacement for every Cypress suite. A team considering the same move should weigh browser coverage, retry and waiting behavior, route interception, authentication fixtures, parallel execution, and the cost of preserving existing test intent.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the first spec was translated by hand

Rather than ask Claude Code to convert the whole suite immediately, yureki_lab manually translated one checkout spec, spending about 90 minutes on it. That example surfaced project-specific choices the agent otherwise might have guessed at: how to map test IDs to Playwright locators, preserve retrying assertions with explicit expect calls, replace an API login helper with per-worker storageState, and adapt cy.intercept() route matching.

The author then captured those decisions in 14 migration rules and included a worked example in the project instructions. The important shift was from treating migration as a syntax conversion to defining what the converted tests must continue to mean.

How the four-day workflow was structured

  1. Translate one representative flow manually. Choose a spec that exercises important project conventions, then record decisions about locators, assertions, authentication, and network interception.
  2. Turn decisions into explicit rules. Include a worked example and tell the agent to stop and report unknown custom commands rather than inventing behavior.
  3. Work in small, fresh-session batches. The author migrated five specs per batch, directing Claude Code to handle one spec at a time and report results before moving on. Fresh sessions helped avoid relying on a long accumulated conversation as the only source of project context.
  4. Run and review the conversions. The written procedure called for repeated runs—three in the procedure—and human review of diffs. A passing run was only one check, not proof that the migration preserved behavior.
  5. Compare rendered output as well as assertions. The author compared screenshots against Cypress baselines, using pixelmatch for diffs. The post gives a threshold of 0.02 in its example; that is a project example, not a universal setting.

The post says the project used Claude Code v2.1.x, Node.js 22, and Playwright 1.54 “at the time.” Those are the versions in this account, not current version recommendations.

What went wrong—and what the checks caught

An undocumented helper concealed application behavior

A custom command, cy.selectPlan('pro'), conditionally dismissed a confirmation dialog. The migrated fixture did not reproduce the behavior because its test data did not trigger that condition. The old helper had also been hiding a real application-flow issue. Because the instructions said to stop on unknown helpers, the agent reported the missing behavior instead of silently guessing. The case shows why custom commands need to be understood as behavior, not merely replaced with similarly named fixture methods.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A valid replacement assertion can still be weaker

In another conversion, an assertion that checked the total’s text became one that checked only whether the element was visible. The new test could pass while no longer verifying the price. The author found that the migration rules were too vague about assertion semantics, added a requirement to preserve them, and reran 11 specs. For each conversion, compare the fact being asserted—not only whether the replacement syntax is valid.

Passing tests did not guarantee equivalent screens

Screenshot comparisons exposed four cases where tests passed but the rendered screen differed: three attributed to animation timing and one to a locator selecting a different button with the same label. Visual comparison supplied a separate signal alongside assertions and code review; it did not establish that every behavior was correct. As yureki_lab put it: “Passing tests are not evidence. Failing-when-they-should tests are.”

What the author reported after migration

Measure Author’s report How to read it
CI runtime About 11 minutes across four workers A result from this suite and setup, not a general speed comparison.
Observed flakiness No observed flake for three weeks An observation window, not proof that the suite is permanently flake-free.
Authentication setup An 80% reduction in login overhead attributed to per-worker storage state The author’s attribution for this project; the post does not establish it as a general expected saving.
Shared test code A 600-line commands file replaced with about 180 lines of typed fixtures A reported project-specific change in organization and size.

All figures in the table come from yureki_lab’s case account; it does not provide an independent study or controlled benchmark.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What another team can take from the case

  • Start with the seams most likely to change meaning. Inspect custom commands, authentication shortcuts, route matching, retry behavior, and assertions before automating broad conversion.
  • Make uncertainty visible. Ask the agent to stop on undocumented helpers and surface unknown behavior for a human decision.
  • Keep batches reviewable. Five-spec batches and one-spec-at-a-time reporting gave this author checkpoints; another team’s sensible batch size depends on complexity and review capacity.
  • Check both behavior and presentation. Assertions, repeated runs, code review, and screenshot comparisons catch different classes of problem; none alone proves equivalence.
  • Validate the reasons for switching. Measure the capabilities and costs that matter to your application—such as parallelism, browser coverage, multi-tab flows, CI time, and fixture design—rather than treating this case’s outcome as a benchmark.

The full account is yureki_lab’s DEV Community post, “How I Migrated 90 Cypress Tests to Playwright With Claude Code in 4 Days”.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.