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
140
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
120
Studying Strapi: an open source head headless CMS
silvenon
0
30
CSS Specificity
silvenon
0
23
Make your JavaScript projects more accessible to newcomers
silvenon
0
66
React Hooks
silvenon
0
65
PostCSS
silvenon
0
38
CSS Custom Properties
silvenon
0
34
Maintainable Integration Testing in React
silvenon
0
23
Writing Codemods with jscodeshift
silvenon
0
23
Other Decks in Programming
See All in Programming
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
120
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.6k
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
7
4.2k
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
良いコードレビューとは
danimal141
7
1.8k
Unity Android XR入門
sakutama_11
0
180
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
1.4k
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
150
PRレビューのお供にDanger
stoticdev
1
240
Datadog Workflow Automation で圧倒的価値提供
showwin
1
280
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
14
4.7k
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
55
19k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
How GitHub (no longer) Works
holman
314
140k
BBQ
matthewcrist
87
9.5k
Music & Morning Musume
bryan
46
6.4k
The Invisible Side of Design
smashingmag
299
50k
Six Lessons from altMBA
skipperchong
27
3.6k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
Unsuck your backbone
ammeep
669
57k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Optimizing for Happiness
mojombo
377
70k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
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 🥳