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
26
Make your JavaScript projects more accessible to newcomers
silvenon
0
69
React Hooks
silvenon
0
69
PostCSS
silvenon
0
41
CSS Custom Properties
silvenon
0
38
Maintainable Integration Testing in React
silvenon
0
29
Writing Codemods with jscodeshift
silvenon
0
26
Other Decks in Programming
See All in Programming
衛星の軌道をWeb地図上に表示する
sankichi92
0
260
#QiitaBash TDDでAIに設計イメージを伝える
ryosukedtomita
2
1.6k
Agent Rules as Domain Parser
yodakeisuke
1
400
Use Perl as Better Shell Script
karupanerura
0
680
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
700
Feature Flag 自動お掃除のための TypeScript プログラム変換
azrsh
PRO
4
650
DevTalks 25 - Create your own AI-infused Java apps with ease
kdubois
2
130
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
610
iOSアプリ開発もLLMで自動運転する
hiragram
6
2.2k
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.8k
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1k
人には人それぞれのサービス層がある
shimabox
3
610
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
336
57k
Typedesign – Prime Four
hannesfritz
41
2.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.3k
Designing Experiences People Love
moore
142
24k
Six Lessons from altMBA
skipperchong
28
3.8k
GitHub's CSS Performance
jonrohan
1031
460k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
6
630
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
15
900
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
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 🥳