Overview
Use Cypress when the deliverable is a UI test suite; use Puppeteer when the deliverable is a script that drives a browser. They are a test framework and an automation library, so they rarely compete. Puppeteer 25 controls Chrome through the DevTools Protocol and Firefox through WebDriver BiDi, and runs headless by default. Playwright overlaps both: it is a test runner plus an automation API across three engines. For pure test-suite choices see playwright-vs-cypress.
Comparison
| Dimension | Cypress 16 | Puppeteer 25 |
|---|---|---|
| Purpose | Test runner with assertions, retries, and runner UI | Browser automation library; bring your own test runner |
| Browsers | Chrome, Edge, Firefox; WebKit experimental; Electron deprecated | Chrome and Firefox |
| Retry and waiting | Commands and assertions retry automatically | Explicit waits (waitForSelector) and your own assertions |
| Network control | cy.intercept | page.setRequestInterception and CDP |
| Component tests | cy.mount | None |
| PDF and screenshots | Screenshots only | page.pdf() and page.screenshot() |
| Scraping and crawling | Poor fit | Designed for it |
| Protocol access | Limited | Chrome DevTools Protocol sessions |
Pick Cypress when
Pick Cypress for a team-maintained UI test suite.
- Retrying queries and assertions remove most timing code.
- The interactive runner shows each command’s DOM snapshot, which speeds up debugging.
- Component tests and
cy.interceptstubs sit beside end-to-end tests.
Pick Puppeteer when
Pick Puppeteer for jobs that are not test assertions.
- Generate PDFs from HTML with
page.pdf()(print CSS applies); common for invoices and reports. - Take screenshots, crawl and scrape across origins, and run scheduled automation; for visual regression, compare screenshots with Playwright’s
toHaveScreenshotor a service such as Percy or Chromatic. - Use CDP for tracing, coverage, throttling, or running Lighthouse against an authenticated page.
- If you need these plus tests, or WebKit, use Playwright instead: its
page.pdf()also works in Chromium, and its test runner is built in.
Migrate
These tools are seldom swapped. Cypress to Puppeteer means replacing cy.* commands with page calls and adding a runner (Vitest or Jest) with explicit waits. Puppeteer to Playwright is the lowest-effort upgrade when you need multiple browsers or tests; the API is close. See testing for test strategy.
FAQ
Should I use Puppeteer for end-to-end testing?
No for a team-maintained UI test suite; Puppeteer is an automation library with no built-in assertions or retries, so use Cypress. If you need tests plus scripting or WebKit, use Playwright.
Can Cypress generate PDFs?
No; Cypress takes screenshots only. Use Puppeteer’s page.pdf() for invoices and reports, or Playwright’s page.pdf() in Chromium.
Is Playwright a replacement for both Cypress and Puppeteer?
Playwright covers both jobs: it is a test runner plus an automation API across three engines. Puppeteer to Playwright is the lowest-effort upgrade because the API is close.