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
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cypress vs. Playwright
Matija Marohnić
September 28, 2022
More Decks by Matija Marohnić
See All by Matija Marohnić
oxlint & oxfmt: linting and formatting from the future
silvenon
0
36
Goodbye jsdom/happy-dom, hello Vitest Browser Mode!
silvenon
0
29
Introduction to Remix
silvenon
0
170
Studying Strapi: an open source head headless CMS
silvenon
0
58
CSS Specificity
silvenon
0
64
Make your JavaScript projects more accessible to newcomers
silvenon
0
98
React Hooks
silvenon
0
98
PostCSS
silvenon
0
67
CSS Custom Properties
silvenon
0
59
Other Decks in Programming
See All in Programming
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
370
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
250
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
240
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
1
370
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
460
業務時間外もAIに働いてもらう話
colorful12
2
8.7k
リアルな遅延を測る仕様
kota_yata
1
130
仕様駆動開発の消費期限
watany
20
9.1k
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
740
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
36
22k
Cloudflare is Agents
chimame
0
180
初めての模倣学習とVLA
natsutan
0
320
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
450
How to Talk to Developers About Accessibility
jct
2
530
How to make the Groovebox
asonas
2
2.4k
4 Signs Your Business is Dying
shpigford
187
23k
The Language of Interfaces
destraynor
162
27k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
670
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
280
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Darren the Foodie - Storyboard
khoart
PRO
3
3.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Docker and Python
trallard
47
4.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 🥳