Change one line in package.json, run your usual npx playwright test, and your suite finishes 2.83x faster on average. Re-running a single test in a warm session shrinks from 652 ms down to 72 ms. You don't have to rewrite a single selector: all you need is Node.js 22.18+ (or Bun) and a quick look at which defaults changed under the hood.
This speedup comes from Flashwright, an independent Apache-2.0 fork of Playwright 1.64.1. It is not affiliated with Microsoft, ships on npm as flashwright-test (1.64.1-flashwright.12), and has its own site at flashwright.dev. Chromium, Firefox, and WebKit browser builds, Trace Viewer, codegen, reporters, and the VS Code extension all remain standard.
One-line swap and native Bun support
When E2E tests crawl, teams usually blame a heavy frontend. In reality, the test runner itself eats most of the time: spawning processes, recompiling files, spinning up a fresh browser profile for every test, and polling between checks. Subtracting real app waits (APIs and timers), Flashwright's pure runner overhead is 2.9–4.8x lower than stock Playwright.
On npm, the fork is split into three packages: flashwright-test replaces @playwright/test, flashwright replaces playwright, and flashwright-core replaces playwright-core. You wire them up with an npm alias, so test imports don't change.
# Alias @playwright/test to the fork (requires Node.js >= 22.18)
npm i -D @playwright/test@npm:flashwright-test
# Install the browser and run your suite as usual
npx playwright install chromium
npx playwright test
# Run TypeScript configs and tests directly on Bun
bunx --bun playwright test
Bun support is a nice bonus here. Stock Playwright 1.64.1 parses TypeScript as plain JavaScript under Bun and crashes on the first type annotation. Flashwright fixes that, so TypeScript tests run directly without a separate build step.
Official Flashwright banner — a Playwright fork for faster E2E test execution (Source: flashwright.dev)
Five under-the-hood optimizations and real benchmarks
Five changes inside the runner and driver power the speedup.
First is reusing BrowserContext—the isolated browser profile holding cookies, localStorage, cache, and permissions (like an incognito window). Stock Playwright spins up a fresh context for every test. Flashwright defaults to isolation: 'recycled': each worker keeps one context, opens a new tab per test, and clears storage, permissions, and routes between tests. On Firefox and WebKit, it reuses the tab itself.
Second, it removes backoff polling—repeated checks with growing 20–500 ms delays that cause tests to miss when an element is ready. Flashwright reacts to page mutations and enables failFastWhenIdle: true: if there are no active timers, requests, sockets, animations, or workers, a failing assertion exits immediately instead of waiting out the timeout.
Third, it skips waiting for animations before input (waitForAnimations: false). Clicks don't pause for CSS transitions to finish, though the built-in hit-target check stays on so the browser still verifies the click hits the button rather than an overlay modal (Electron keeps the old behavior).
Fourth, workers and browsers start early in parallel with config loading, paired with code caching, lazy loading, and testOrder: 'longest-first' so the slowest tests from the previous run start first. Fifth, lighter locators skip redundant style and accessible-name recalculations, while toHaveScreenshot() gets faster pixel-identical PNG encoding and a fast path for unchanged baselines.
Suite runs in CI mode (4 workers, Chromium headless)
These numbers were measured on a 6-core Linux machine without a warm session, matching CI. The fork is at least twice as fast in every scenario, and reaches up to 4x on rapid click-and-assert flows or failing tests. Even in the shop scenario with backend latency, lower runner overhead cuts total time by more than half. Across nine frameworks on the 24 TodoMVC tests (1 worker), Flashwright finishes in 2.36 s versus 4.48 s for Playwright, 4.30 s for experimental Bun.WebView, 10.32 s for WebdriverIO, and 16.97 s for Cypress.
On the 8,500-node admin page, getByRole() takes 14 ms compared to 0.7 ms for getByTestId(), so setting locatorPolicy: 'test-id' helps if you have data-testid attributes. For functional specs, you can also set test.use({ instantAnimations: true, blockResources: ['image', 'font', 'media'] }) to speed up Chromium animations 1000x and skip heavy assets.
Warm browser, AI-agent mode, and demo recordings
In local work and coding-agent loops, the biggest time sink is the "edit a line → re-run one test → wait" cycle. Flashwright tackles this with a warm session.
On a local machine, the first run starts a background process that keeps browsers warmed up for up to five minutes (FLASHWRIGHT_SESSION_TIMEOUT). Edits to tests, config, or environment variables are picked up by fresh runner and worker processes. Re-running one TodoMVC test takes 72 ms instead of 234 ms on cold Flashwright or 652 ms on Playwright—9.1x faster. The session holds 0.4 GB of RAM after a single test and about 1 GB after four workers; it stays off in CI, on Windows, and under a debugger.
When tests are launched by Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, or with AI_AGENT set, agentMode activates. The agent reporter prints only failures and writes test-results/summary.json with outcomes, attachment paths, and a re-run command. On 201 tests with one failure, output shrinks from 425 lines (17.5 KB) to 26 lines (888 bytes), and on a broken locator the runner suggests matching elements on the page within half a second.
# Check project readiness (JSON output works well in scripts)
npx playwright doctor --json
# Re-run affected tests on file save
npx playwright test --watch
# Agent MCP server without the fixed 500 ms pause
playwright mcp --adaptive-settle
In --watch mode, results arrive 255 ms after saving instead of 1,065 ms. The --adaptive-settle flag on the MCP server (Model Context Protocol for agent browser control) returns control as soon as the page stabilizes without a half-second wait, cutting an API save flow from 1,014 ms to 234 ms.
On top of that, Flashwright adds per-project webServer, --prune-snapshots, npx playwright accept-snapshots, and video recording. --video captures cursor movement, camera framing, and auto-captions, while --demo records a clean screen with narrate() commentary. You'll need ffmpeg, and be careful with sensitive data: captions include all typed text, including passwords, so never feed real secrets into it.
The trade-offs: six changed defaults and where it fits
Speed comes from changed defaults, and some existing tests may notice. Compatibility with Playwright 1.64.1 suites is high: in Chromium, 2,616/2,616 tests/page pass; in Firefox, 2,590 (+4 when run solo); tests/stress finishes 1,100/1,100 in 20 s instead of 49 s; and tests/playwright-test, tests/mcp, tests/electron, and tests/extension match stock behavior. However, two internal checks in tests/library noticed the recycled context, and 8 of 2,610 page tests needed failFastWhenIdle: false because a Node.js-side timer mutated the page while an assertion was waiting.
If a suite starts flaking after switching, you can restore stock defaults per file in playwright.config.ts or via FLASHWRIGHT_ISOLATION=strict and FLASHWRIGHT_SESSION=0.
import { defineConfig } from '@playwright/test';
export default defineConfig({
// File order instead of 'longest-first'
testOrder: 'file',
use: {
// Fresh BrowserContext per test
isolation: 'strict',
// Wait for CSS/Web animations before clicks
waitForAnimations: true,
// Do not fail assertions early on an idle page
failFastWhenIdle: false,
},
});
Usually, applying those flags to a single finicky file with test.use(...) is enough to keep the rest of the suite fast.
- Recycled contexts (
isolation: 'recycled'). Firefox and WebKit also reuse the tab and history. Rollback:isolation: 'strict'orFLASHWRIGHT_ISOLATION=strict. - Skipped animations (
waitForAnimations: false). If your UI drops clicks while moving, setwaitForAnimations: true. - Early failure (
failFastWhenIdle: true). Causes trouble if a Node.js timer mutates the page. Rollback:failFastWhenIdle: false. - Test order
testOrder: 'longest-first'. If tests depend on order, switch back totestOrder: 'file'. - Background warm session. Holds 0.4–1 GB of RAM locally for up to 5 minutes. Rollback:
FLASHWRIGHT_SESSION=0. - PNG file size. Screenshots are 1.6–1.9x larger with identical pixels;
toHaveScreenshot()baselines still match.
For local development, --watch, and AI-agent loops, Flashwright is a great fit: the speed boost is immediate and you can revert with one npm command. For critical production release CI, it's still a bit early. The fork is roughly two months old, has three contributors and about 1,500 monthly downloads, is pinned to Playwright 1.64.1, and has no Microsoft backing. Keep stock Playwright for final release gates, and run Flashwright on developer laptops and agent pipelines.

