Flashwright claims to run end-to-end tests up to four times faster than Playwright. What accounts for the speedup, and when might the tradeoffs matter?
How does Flashwright speed up end-to-end tests, and what are the tradeoffs?
Answers
A big part of the proposed speedup is reusing a browser context within each worker instead of starting every test in a fresh context. That can avoid repeatedly paying the cold-start cost of compiling the app's JavaScript.
The tradeoff is isolation. State left behind by one test could affect a later test on the same worker, causing a failure or hiding a bug. The concern isn't that parallel workers all share one context.
Reply to this answer
Context reuse may be fine for some relatively independent checks, such as simple navigation or static component tests. It deserves more scrutiny for tests that change browser state or depend on a clean session.
The discussion also raises the possibility of listeners, network interceptors, or logging hanging around between tests. Check how those are cleaned up before relying on recycled contexts.
Reply to this answer
I'd treat four times faster as an upper-end claim, not a prediction for your suite. One reported comparison found only a small gain, around five percent, and considered it within the margin of error. Try it against your own tests and compare both runtime and reliability.
Reply to this answer
One practical catch if you rely on Playwright tracing: Flashwright reportedly skips the built-in tracing to reach its speed claims. Faster runs might be less useful if you lose a debugging tool your team depends on, so check that before switching.
Reply to this answer
The individual optimizations can reportedly be turned off, which makes this less of an all-or-nothing choice. There's still a fair question about whether context reuse belongs as an option in Playwright rather than a separate package. Flashwright also claims other optimizations and convenience features beyond that one change.
Reply to this answer
Add your answer
Answers are reviewed before publication.
p.327!cobblevisor:
Flashwright also offers a strict isolation option for a fresh context per test, so you can choose isolation over reuse where it matters.