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
170
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
30
Goodbye jsdom/happy-dom, hello Vitest Browser Mode!
silvenon
0
23
Introduction to Remix
silvenon
0
160
Studying Strapi: an open source head headless CMS
silvenon
0
57
CSS Specificity
silvenon
0
64
Make your JavaScript projects more accessible to newcomers
silvenon
0
92
React Hooks
silvenon
0
95
PostCSS
silvenon
0
65
CSS Custom Properties
silvenon
0
53
Other Decks in Programming
See All in Programming
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
130
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
800
Inside Stream API
skrb
1
760
Oxcを導入して開発体験が向上した話
yug1224
4
330
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
210
AI 輔助遺留系統現代化的經驗分享
jame2408
1
960
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
140
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.4k
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
290
Featured
See All Featured
Done Done
chrislema
186
16k
A Tale of Four Properties
chriscoyier
163
24k
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
430
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
Navigating Weather and Climate Data
rabernat
0
230
RailsConf 2023
tenderlove
30
1.5k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
580
Information Architects: The Missing Link in Design Systems
soysaucechin
0
980
How to build a perfect <img>
jonoalderson
1
5.7k
sira's awesome portfolio website redesign presentation
elsirapls
0
280
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 🥳