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
21
Make your JavaScript projects more accessible to newcomers
silvenon
0
64
React Hooks
silvenon
0
62
PostCSS
silvenon
0
36
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
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
ASP.NET Core の OpenAPIサポート
h455h1
0
120
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
4
240
DMMオンラインサロンアプリのSwift化
hayatan
0
190
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.8k
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
1
450
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.2k
HTML/CSS超絶浅い説明
yuki0329
0
190
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
940
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
A better future with KSS
kneath
238
17k
Mobile First: as difficult as doing things right
swwweet
222
9k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Faster Mobile Websites
deanohume
305
30k
4 Signs Your Business is Dying
shpigford
182
22k
Making Projects Easy
brettharned
116
6k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
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 🥳