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
120
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
94
Studying Strapi: an open source head headless CMS
silvenon
0
23
CSS Specificity
silvenon
0
20
Make your JavaScript projects more accessible to newcomers
silvenon
0
47
React Hooks
silvenon
0
57
PostCSS
silvenon
0
30
CSS Custom Properties
silvenon
0
25
Maintainable Integration Testing in React
silvenon
0
15
Writing Codemods with jscodeshift
silvenon
0
18
Other Decks in Programming
See All in Programming
Try creating your own orderedmap
kazamori
1
190
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
110
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
1k
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
170
Site Reliability Engineering for GMO
pyama86
8
1.1k
Goのmultiple errorsについて (2024年4月版)
syumai
4
1.2k
Fragment Composition of GraphQL
quramy
13
1.4k
敵対的ポイフル
futabato
0
130
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
300
Next.js App Router
quramy
12
1.8k
Snowflakeで眠ったデータを起こそう!
estie
0
140
2 週間で Twitter Bot を作ってみた
contour_gara
0
770
Featured
See All Featured
It's Worth the Effort
3n
180
27k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
The Invisible Customer
myddelton
114
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Designing for humans not robots
tammielis
247
25k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
GitHub's CSS Performance
jonrohan
1025
450k
Building Your Own Lightsaber
phodgson
100
5.7k
Visualization
eitanlees
137
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
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 🥳