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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Matija Marohnić
September 28, 2022
Programming
0
160
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
9
Introduction to Remix
silvenon
0
140
Studying Strapi: an open source head headless CMS
silvenon
0
48
CSS Specificity
silvenon
0
46
Make your JavaScript projects more accessible to newcomers
silvenon
0
78
React Hooks
silvenon
0
84
PostCSS
silvenon
0
45
CSS Custom Properties
silvenon
0
40
Maintainable Integration Testing in React
silvenon
0
48
Other Decks in Programming
See All in Programming
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
SourceGeneratorのススメ
htkym
0
190
Oxlintはいいぞ
yug1224
5
1.3k
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.8k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
dchart: charts from deck markup
ajstarks
3
990
AI巻き込み型コードレビューのススメ
nealle
1
160
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
77
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Everyday Curiosity
cassininazir
0
130
Become a Pro
speakerdeck
PRO
31
5.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Skip the Path - Find Your Career Trail
mkilby
0
54
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
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 🥳