End-to-end testing catches bugs that unit tests miss. Cypress was the first developer-friendly E2E tool. Playwright, backed by Microsoft, has become a serious challenger. Here is how they compare.
Architecture
Cypress: Runs inside the browser. Tests execute in the same event loop as your application. Uses a proxy to intercept network requests.
Playwright: Controls browsers via the DevTools Protocol. Tests run in Node.js, communicating with browsers externally. Supports Chrome, Firefox, and Safari natively.
Feature Comparison
| Feature | Cypress | Playwright |
|---|---|---|
| Browser support | Chrome, Firefox, Edge, Electron | Chrome, Firefox, Safari, Edge |
| Safari testing | No | Yes (WebKit) |
| Parallel execution | Cloud (paid) | Built-in (free) |
| Multi-tab support | No | Yes |
| iframe support | Limited | Full |
| File upload/download | Plugin-based | Built-in |
| Network interception | cy.intercept | route/page.route |
| Visual testing | Plugin (Percy) | Screenshots + comparison |
| Component testing | Built-in | Experimental |
| API testing | cy.request | request context |
| Mobile emulation | Viewport only | Full device emulation |
| Trace viewer | No | Yes (built-in) |
| Speed | Moderate | Fast |
| Language support | JavaScript/TypeScript | JS/TS, Python, Java, .NET, Go |
Speed Comparison
Running the same 100-test suite:
| Metric | Cypress | Playwright |
|---|---|---|
| Sequential execution | 8 minutes | 5 minutes |
| Parallel (4 workers) | N/A (paid cloud) | 1.5 minutes |
| Test startup time | 3-5 seconds | 1-2 seconds |
| Browser launch | Reuses browser | Fresh context per test |
Playwright is 30-60% faster in sequential mode and offers free parallel execution that Cypress charges for.
Developer Experience
Cypress
describe('Login', () => {
it('should log in with valid credentials', () => {
cy.visit('/login')
cy.get('[data-testid="email"]').type('user@example.com')
cy.get('[data-testid="password"]').type('password123')
cy.get('[data-testid="submit"]').click()
cy.url().should('include', '/dashboard')
cy.get('[data-testid="welcome"]').should('contain', 'Welcome')
})
})
Cypress strengths:
- Time-travel debugger (step through test execution)
- Automatic waiting (no manual waits needed)
- cy.intercept for network mocking
- Cypress Dashboard for CI insights (paid)
- Hot reload during test development
Playwright
test('should log in with valid credentials', async ({ page }) => {
await page.goto('/login')
await page.getByTestId('email').fill('user@example.com')
await page.getByTestId('password').fill('password123')
await page.getByTestId('submit').click()
await expect(page).toHaveURL(/dashboard/)
await expect(page.getByTestId('welcome')).toContainText('Welcome')
})
Playwright strengths:
- Trace viewer (record and replay failures)
- Codegen (auto-generate tests by browsing)
- Auto-waiting built-in
- Test generator UI
- Built-in assertions with retries
- Fixtures for clean test setup
Pricing
Cypress
| Component | Cost |
|---|---|
| Framework (open source) | Free |
| Cypress Cloud (parallelization) | $67-299+/month |
| Parallel testing (cloud) | Required for CI parallelization |
Playwright
| Component | Cost |
|---|---|
| Framework (open source) | Free |
| Parallel testing | Free (built-in) |
| Trace viewer | Free |
| All features | Free |
Playwright is fully free. Cypress's paid cloud service provides parallelization, dashboards, and flake detection that Playwright includes for free.
CI Integration
Cypress in CI
# GitHub Actions
- name: Cypress Tests
uses: cypress-io/github-action@v6
with:
start: npm run dev
wait-on: http://localhost:3000
Works well but parallel execution requires Cypress Cloud (paid).
Playwright in CI
# GitHub Actions
- name: Playwright Tests
run: npx playwright test
env:
CI: true
Parallel execution works out of the box with workers configuration.
When to Choose Cypress
- Component testing is a priority (Cypress's component testing is more mature)
- Time-travel debugger is important for your workflow
- Existing Cypress test suite (migration cost is real)
- Team prefers the Cypress DX (subjective but valid)
- Cypress Cloud features (flake detection, analytics)
When to Choose Playwright
- Safari testing is required (Playwright is the only option)
- Multi-tab or multi-browser scenarios
- Free parallel execution in CI
- Speed is important (faster test execution)
- Non-JS languages (Python, Java, .NET teams)
- Trace viewer for debugging CI failures
- New project (no migration cost, better defaults)
Migration
Migrating from Cypress to Playwright:
| Suite Size | Effort |
|---|---|
| < 50 tests | 1-2 days |
| 50-200 tests | 3-5 days |
| 200-500 tests | 1-2 weeks |
| 500+ tests | 2-4 weeks |
The main work is rewriting cy. commands to page. commands and updating assertions.
Our Choice
We use Playwright for all E2E testing. Free parallel execution, Safari support, the trace viewer, and faster test execution make it our default. The codegen feature also accelerates test writing.
Contact us to discuss testing strategy for your application.