Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Cypress vs. Playwright
Search
Matija Marohnić
September 28, 2022
Programming
190
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
47
Goodbye jsdom/happy-dom, hello Vitest Browser Mode!
silvenon
0
35
Introduction to Remix
silvenon
0
180
Studying Strapi: an open source head headless CMS
silvenon
0
67
CSS Specificity
silvenon
0
75
Make your JavaScript projects more accessible to newcomers
silvenon
0
100
React Hooks
silvenon
0
100
PostCSS
silvenon
0
72
CSS Custom Properties
silvenon
0
70
Other Decks in Programming
See All in Programming
ジョジョの世界をXRで再現する
mofurune
0
140
mrbgem 三角測量 開発
ogom
0
220
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
100
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
280
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
210
AWSに止められる覚悟してますか?
morizo_1984
2
520
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5k
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
1
410
すこし踏み込む CancellationToken
htkym
2
1.7k
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
450
setup-vp GitLab対応の裏側
naokihaba
0
160
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
520
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
320
Faster Mobile Websites
deanohume
310
32k
The Curse of the Amulet
leimatthew05
3
15k
Optimizing for Happiness
mojombo
378
71k
The SEO Collaboration Effect
kristinabergwall1
1
590
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Code Review Best Practice
trishagee
74
20k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Designing for Timeless Needs
cassininazir
1
520
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 🥳