Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cypress vs. Playwright

Cypress vs. Playwright

Matija Marohnić

September 28, 2022
Tweet

More Decks by Matija Marohnić

Other Decks in Programming

Transcript

  1. Background • prior experience with tools like WebdriverIO • used

    Cypress for a long time • friendlier API • approachable • but eventually mostly for critical functionality
  2. Speed • 5 tests = 45s (locally) • compared to

    my other optimizations it became uncomfortable • started writing less tests 💔
  3. GUI

  4. Background • new testing framework by Microsoft • haven’t used

    it in any serious projects yet • only side projects
  5. Supports WebKit • unlike Cypress, Playwright supports Safari • Safari’s

    support table can be uncomfortable, so it’s really useful
  6. Headless by default • seemed odd at fi rst •

    turned out to be a great feature • less clutter, no dashboards or browsers • run headed only when you need to debug
  7. Speed • 13 tests = 3s ⚡ • more than

    2x as many tests = 15x faster • speed is no longer an issue • started testing every square inch of my blog
  8. API • at fi rst repetitive and error-prone, mistakes aren’t

    always obvious • but gives full control over execution order, more transparent
  9. API • uses Jest’s expect library for assertions, so looks

    more like a unit test • doesn’t need a Testing Library plugin, locators are powerful
  10. VS Code extension 🤯 • killer feature • makes Playwright

    really e ffi cient to use! • run a test just by clicking on it, and much more • a more balanced approach to GUI — stay in your text editor • 👨💻
  11. • I’m always excited to learn more about Playwright •

    it makes me want to write more tests 🥳