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
150
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
130
Studying Strapi: an open source head headless CMS
silvenon
0
33
CSS Specificity
silvenon
0
28
Make your JavaScript projects more accessible to newcomers
silvenon
0
72
React Hooks
silvenon
0
70
PostCSS
silvenon
0
42
CSS Custom Properties
silvenon
0
39
Maintainable Integration Testing in React
silvenon
0
29
Writing Codemods with jscodeshift
silvenon
0
27
Other Decks in Programming
See All in Programming
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
360
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
570
生成AIで日々のエラー調査を進めたい
yuyaabo
0
640
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
110
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
150
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
240
WindowInsetsだってテストしたい
ryunen344
1
190
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
670
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
17
4.9k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
69
4.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Docker and Python
trallard
44
3.4k
Producing Creativity
orderedlist
PRO
346
40k
Speed Design
sergeychernyshev
32
1k
Unsuck your backbone
ammeep
671
58k
Making Projects Easy
brettharned
116
6.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
33
5.9k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Adopting Sorbet at Scale
ufuk
77
9.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Become a Pro
speakerdeck
PRO
28
5.4k
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 🥳