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
SwiftDataのカスタムデータストアを試してみた
1mash0
0
140
ニーリーQAのこれまでとこれから
nealle
2
500
Laravel × Clean Architecture
bumptakayuki
PRO
0
140
The Implementations of Advanced LR Parser Algorithm
junk0612
2
1.4k
Jakarta EE Meets AI
ivargrimstad
0
830
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
110
Thank you <💅>, What's the Next?
ahoxa
1
590
Designing Your Organization's Test Pyramid ( #scrumniigata )
teyamagu
PRO
4
860
Носок на сок
bo0om
0
1.2k
AI時代の開発者評価について
ayumuu
0
230
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
3
12k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
Done Done
chrislema
184
16k
Site-Speed That Sticks
csswizardry
6
530
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
Practical Orchestrator
shlominoach
187
11k
KATA
mclloyd
29
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
A designer walks into a library…
pauljervisheath
205
24k
It's Worth the Effort
3n
184
28k
Designing for Performance
lara
608
69k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
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 🥳