Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
160
Cypress vs. Playwright
Matija Marohnić
September 28, 2022
Tweet
Share
More Decks by Matija Marohnić
See All by Matija Marohnić
Goodbye jsdom/happy-dom, hello Vitest Browser Mode!
silvenon
0
9
Introduction to Remix
silvenon
0
140
Studying Strapi: an open source head headless CMS
silvenon
0
46
CSS Specificity
silvenon
0
36
Make your JavaScript projects more accessible to newcomers
silvenon
0
76
React Hooks
silvenon
0
81
PostCSS
silvenon
0
45
CSS Custom Properties
silvenon
0
40
Maintainable Integration Testing in React
silvenon
0
45
Other Decks in Programming
See All in Programming
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
AIコーディングエージェント(Manus)
kondai24
0
210
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
260
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
170
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.3k
AIコーディングエージェント(NotebookLM)
kondai24
0
230
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
360
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
tparseでgo testの出力を見やすくする
utgwkk
2
280
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
290
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
250
エンジニアに許された特別な時間の終わり
watany
105
220k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
286
14k
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
370
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Curious Case for Waylosing
cassininazir
0
190
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
Fireside Chat
paigeccino
41
3.8k
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 🥳