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
150
Cypress vs. Playwright
Matija Marohnić
September 28, 2022
Tweet
Share
More Decks by Matija Marohnić
See All by Matija Marohnić
Introduction to Remix
silvenon
0
130
Studying Strapi: an open source head headless CMS
silvenon
0
33
CSS Specificity
silvenon
0
25
Make your JavaScript projects more accessible to newcomers
silvenon
0
69
React Hooks
silvenon
0
67
PostCSS
silvenon
0
41
CSS Custom Properties
silvenon
0
37
Maintainable Integration Testing in React
silvenon
0
28
Writing Codemods with jscodeshift
silvenon
0
26
Other Decks in Programming
See All in Programming
RuboCop: Modularity and AST Insights
koic
2
2.6k
Storybookの情報をMCPサーバー化する
shota_tech
1
620
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.3k
Flutterでllama.cppをつかってローカルLLMを試してみた
sakuraidayo
0
130
LRパーサーはいいぞ
ydah
6
1.2k
Improve my own Ruby
sisshiki1969
0
100
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
110
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
390
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
個人開発の学生アプリが企業譲渡されるまで
akidon0000
2
1.2k
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
110
監視 やばい
syossan27
12
10k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
344
40k
How to Ace a Technical Interview
jacobian
276
23k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
4 Signs Your Business is Dying
shpigford
183
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.4k
Automating Front-end Workflow
addyosmani
1370
200k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Why Our Code Smells
bkeepers
PRO
336
57k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
420
How to Think Like a Performance Engineer
csswizardry
23
1.6k
How STYLIGHT went responsive
nonsquared
100
5.5k
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 🥳