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
27
CSS Specificity
silvenon
0
21
Make your JavaScript projects more accessible to newcomers
silvenon
0
62
React Hooks
silvenon
0
62
PostCSS
silvenon
0
34
CSS Custom Properties
silvenon
0
32
Maintainable Integration Testing in React
silvenon
0
21
Writing Codemods with jscodeshift
silvenon
0
19
Other Decks in Programming
See All in Programming
gopls を改造したら開発生産性が高まった
satorunooshie
7
140
フロントエンドの現在地とこれから
koba04
10
4.7k
GPU Hash Table | レイトレ合宿10
yknishidate
0
350
cgroup v2 support in Kubeadm
kentatada
0
220
テスト駆動開発✅️
akitoshiga
1
180
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
290
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.2k
4年間変わらなかった YOUTRUSTのアーキテクチャ
daiki1003
2
710
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
160
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
1
140
2024-10-02 dev2next - Application Observability like you've never heard before
jonatan_ivanov
0
200
書籍『LangChainとLangGraphによるRAG・AIエージェント[実践]入門』の紹介
os1ma
2
130
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Happy Clients
brianwarren
97
6.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
Writing Fast Ruby
sferik
626
60k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
23k
How STYLIGHT went responsive
nonsquared
95
5.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
Code Reviewing Like a Champion
maltzj
519
39k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.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 🥳