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
49
CSS Specificity
silvenon
0
47
Make your JavaScript projects more accessible to newcomers
silvenon
0
80
React Hooks
silvenon
0
85
PostCSS
silvenon
0
46
CSS Custom Properties
silvenon
0
43
Maintainable Integration Testing in React
silvenon
0
50
Other Decks in Programming
See All in Programming
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
200
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.1k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
470
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
490
ふん…おもしれぇ Parser。RubyKaigi 行ってやるぜ
aki_pin0
0
110
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
130
CSC307 Lecture 09
javiergs
PRO
1
850
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
430
ぼくの開発環境2026
yuzneri
1
290
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
A better future with KSS
kneath
240
18k
Mobile First: as difficult as doing things right
swwweet
225
10k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
170
Speed Design
sergeychernyshev
33
1.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Optimizing for Happiness
mojombo
379
71k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
200
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 🥳