Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cypress vs. Playwright
Search
Matija Marohnić
September 28, 2022
Programming
0
170
Cypress vs. Playwright
Matija Marohnić
September 28, 2022
Tweet
Share
More Decks by Matija Marohnić
See All by Matija Marohnić
Goodbye jsdom/happy-dom, hello Vitest Browser Mode!
silvenon
0
10
Introduction to Remix
silvenon
0
150
Studying Strapi: an open source head headless CMS
silvenon
0
50
CSS Specificity
silvenon
0
48
Make your JavaScript projects more accessible to newcomers
silvenon
0
81
React Hooks
silvenon
0
85
PostCSS
silvenon
0
47
CSS Custom Properties
silvenon
0
47
Maintainable Integration Testing in React
silvenon
0
51
Other Decks in Programming
See All in Programming
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
130
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
620
AI活用のコスパを最大化する方法
ochtum
0
260
PHPで TLSのプロトコルを実装してみる
higaki_program
0
330
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
530
Java 21/25 Virtual Threads 소개
debop
0
180
Ruby and LLM Ecosystem 2nd
koic
1
1.2k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
280
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
360
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
740
Windows on Ryzen and I
seosoft
0
330
The free-lunch guide to idea circularity
hollycummins
0
290
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
550
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
570
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Producing Creativity
orderedlist
PRO
348
40k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
160
Building Applications with DynamoDB
mza
96
7k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
52k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
87
Transcript
Matija Marohnić Cypress vs. Playwright End-to-end testing showdown https://silvenon.com/blog/e2e-testing-with-cypress-vs-playwright
My experience with Cypress
Background • prior experience with tools like WebdriverIO • used
Cypress for a long time • friendlier API • approachable • but eventually mostly for critical functionality
Speed • 5 tests = 45s (locally) • compared to
my other optimizations it became uncomfortable • started writing less tests 💔
GUI 🤷
GUI
API • familiarity = jQuery 😔 • won’t look familiar
to any new developers
API • should = expect
API • wrap objects to make assertions • another round
of jQuery for everyone! 🍻
API • synchronous…? • commands are queued to be run
later
Meet Playwright 🎭
Background • new testing framework by Microsoft • haven’t used
it in any serious projects yet • only side projects
Supports WebKit • unlike Cypress, Playwright supports Safari • Safari’s
support table can be uncomfortable, so it’s really useful
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
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
API • asynchronous, almost everything needs to be awaited
API • at fi rst repetitive and error-prone, mistakes aren’t
always obvious • but gives full control over execution order, more transparent
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
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 • 👨💻
…and so much more!
• I’m always excited to learn more about Playwright •
it makes me want to write more tests 🥳