Skip to content
steelabs

Test automation

Playwright vs Cypress: one architectural difference, and its consequences

The two runners differ structurally in one way, and nearly every practical distinction falls out of it. What that means for redirects, parallelism, debugging, and who ends up maintaining the suite.

8 min read

This question usually gets asked as though a benchmark could settle it, and the honest opening is that the runner is seldom why a browser suite succeeds or fails. Suites collapse over shared data, unstable locators and a pipeline nobody believes, and every one of those problems migrates cheerfully into whichever tool you pick next.

That said, there is one genuine difference between these two, it is architectural, and it predicts almost everything else. Knowing it turns a shopping exercise into a five-minute decision.

Where the two tools actually diverge

Cypress loads your application and its own test code into the same browser tab and shares an event loop with it. Playwright sits in a separate process and commands the browser over a control protocol, the way a debugger does.

Sitting inside the page buys immediacy. The runner can see the application’s own objects, pause on a failing assertion with the DOM still live, and give a front-end developer a feedback loop that feels like the one they already use. Sitting outside the page buys reach. A process that is not part of the tab is unbothered by how many tabs there are, which origin each one is on, or whether the browser is Chromium at all.

Everything below is a consequence of where the test code runs. Neither position is an oversight; each is a trade that was made deliberately.

Dimension by dimension

Both tools change quickly. Treat this as the shape of the trade rather than as a feature matrix with a shelf life.
DimensionPlaywrightCypress
Execution modelSeparate process driving the browser over a protocolTest code executing inside the application’s tab
Browser enginesChromium, Firefox and WebKit builds that ship with the toolChromium family and Firefox as the well-trodden path; WebKit support has trailed
Parallel executionWorkers and sharding in the open-source runner, no external service neededDepends on the vendor’s orchestration service or a third-party equivalent
Journeys that change originNot a special case; the driver does not care which origin the tab is onNeeds an explicit command around the crossing, so redirect flows are written deliberately
A second tab or windowA first-class concept the API exposesOutside the model; the flow is reshaped, usually by asserting on the link rather than following it
Debugging a failure nobody watchedA recorded trace replayed step by step after the factStrongest while you are present, weaker for a run that failed overnight
Component-level testingSupported, and not the centre of gravityA primary use case, and the reason many front-end teams adopt it
Language reachTypeScript and JavaScript lead, with maintained ports for other languagesJavaScript and TypeScript only, which is a feature if that is your stack
Learning curve for a back-end engineerFamiliar: it behaves like any other library you callRequires learning a chained command queue that does not await the way people expect

The three situations where the difference is decisive

Your sign-in leaves your domain

If authentication redirects to an external identity provider, or checkout hands off to a payment page, the in-page model has to work around a boundary the out-of-process model never meets. Both tools can get there in the end. Only one of them gets there without the test author thinking about it, and on a suite of any size that difference compounds.

The better answer in either tool is to stop driving somebody else’s login screen and establish the session programmatically instead. That is worth doing regardless, because a third party’s redesign should not be able to turn your pipeline red.

Your run-time budget is tight

A suite that gates a merge lives inside a fixed number of minutes, and the only way to buy minutes back is to run tests at the same time. If parallelism arrives with the runner, that is a configuration line. If it arrives with a subscription, it is a procurement conversation, and the two feel very different when the suite is already too slow and the argument is happening in week nine.

Somebody has to explain a failure from last night

The value of an artefact that can be replayed cold is easy to underrate until a scheduled run fails and nobody was watching. Without one, the reflex is to re-run and hope, which is precisely the habit that lets flakiness take root.

Where Cypress is the better choice

We reach for it in three situations, and the first one is the strongest argument either tool has:

  • The suite will be owned by front-end developers after we leave. The interactive runner teaches people to write tests rather than merely permitting it, and a suite the client team actually extends beats a technically superior one they avoid.
  • Component testing is central to the plan. Exercising a component in isolation, in a real browser, next to the code that renders it, is a workflow this tool has invested in heavily.
  • A working suite already exists in it. Coverage that passes reliably is an asset, and converting it produces new code, new defects and no new features.

What the choice does not decide

It is worth being blunt about the size of this decision relative to the ones around it. The runner does not determine how test data is obtained, whether tests can run concurrently, whether locators survive a refactor, what happens when a run goes red, or whether anyone is accountable for the result. Those five decide the outcome, and a team that gets them right will succeed in either tool while a team that gets them wrong will fail in both.

This is why a comparison like this one is worth about an hour of anybody’s time and no more. The hours after that are better spent deciding how a test acquires the state it needs, how elements will be addressed so a refactor does not break forty specs at once, and what the run-time budget of the gating tier is going to be. Those answers are identical in both tools, they are considerably harder to reverse, and they are the ones that will still matter in a year.

Should you migrate an existing suite?

Usually not, and almost never as a project with its own budget line. A migration converts working coverage into new code, ships nothing to a customer, and takes weeks that a stakeholder will eventually ask about.

There is a narrower move that does pay. Where specific specs hurt for structural reasons — a redirect through an external provider, a flow that opens a second window, a shard you cannot parallelise — port those specs and leave the rest alone. Two runners in one repository is a mild inconvenience, and it is a much smaller one than a rewrite.

Our default, and the reason for it

Starting from nothing, we reach for Playwright, because parallelism, several engines, cross-origin journeys and after-the-fact traces all arrive without workarounds, and because the API reads like an ordinary library to engineers who do not write front-end code for a living.

The default flips when the people maintaining the suite in a year are front-end developers who already live in the other tool. That is not a technical argument and it beats the technical arguments, because a suite is maintained by whoever finds it comfortable, and one that nobody extends stops being true within two releases.

Quick answers

Common questions

Is Playwright better than Cypress?

For a new suite built by a mixed engineering team, usually yes: parallel execution, multiple browser engines, cross-origin journeys and replayable traces all work without workarounds. Cypress remains the better answer where front-end developers will own the suite, where component testing is central, or where a healthy suite already exists in it.

Can Cypress handle login through an external identity provider?

Yes, using its explicit cross-origin command, though it takes deliberate handling rather than working transparently. The more durable pattern in either tool is to authenticate programmatically once and reuse the session, which runs faster and stops a provider’s interface changes from breaking your pipeline.

Is it worth migrating from Cypress to Playwright?

Rarely as a whole-suite project. It turns passing coverage into new code and delivers nothing to users. Porting the specific specs that hurt for structural reasons — external redirects, second windows, anything you cannot parallelise — captures most of the benefit for a fraction of the cost, and running both tools in one repository is a smaller problem than a rewrite.

Does the choice of runner cause flaky tests?

Almost never. Instability comes from shared test data, timing assumptions and environment variability, all of which survive a change of tool intact. Changing runner to fix flakiness is an expensive way to postpone the structural work that was always the actual fix.

Contact

Want this applied to your product?

Articles generalise; your situation does not. Describe what you are dealing with and we will tell you which parts of the above actually apply.