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
I like my tests, like I like my friends, flake-...
Search
Amir Rustamzadeh
August 22, 2018
Programming
0
200
I like my tests, like I like my friends, flake-free and reliable
Cypress end-to-end testing talk given at JS Conf US in Carlsbad, CA.
Amir Rustamzadeh
August 22, 2018
Tweet
Share
More Decks by Amir Rustamzadeh
See All by Amir Rustamzadeh
Scalable Testing Practices for Modern Apps
amir
1
400
End-to-End Testing Vue Apps with Cypress
amir
2
390
REFACTR.Tech Cypress Workshop Intro
amir
1
190
Next-Generation Web Application End-to-End Testing with Cypress
amir
0
400
Other Decks in Programming
See All in Programming
階層構造を表現するデータ構造とリファクタリング 〜1年で10倍成長したプロダクトの変化と課題〜
yuhisatoxxx
3
830
iOSDC.pdf
chronos2500
2
640
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
640
Server Less Code More - コードを書かない時代に生きるサーバーレスデザイン / server-less-code-more
gawa
5
1.9k
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
140
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
900
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
670
気づいて!アプリからのSOS 〜App Store Connect APIで始めるパフォーマンス健康診断〜
waka12
0
250
iOS 17で追加されたSubscriptionStoreView を利用して5分でサブスク実装チャレンジ
natmark
0
430
エンジニアとして高みを目指す、 利益を生み出す設計の考え方 / design-for-profit
minodriven
23
11k
ИИ-Агенты в каждый дом – Алексей Порядин, PythoNN
sobolevn
0
140
Reduxモダナイズ 〜コードのモダン化を通して、将来のライブラリ移行に備える〜
pvcresin
2
630
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Become a Pro
speakerdeck
PRO
29
5.5k
Context Engineering - Making Every Token Count
addyosmani
3
150
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Designing for humans not robots
tammielis
254
25k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Done Done
chrislema
185
16k
Unsuck your backbone
ammeep
671
58k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Transcript
I like my tests, like I like my friends, flake-free
and reliable Amir Rustamzadeh @amirrustam JS Conf ! 2018
Sr. Software Engineer @amirrustam Amir Rustamzadeh
[email protected]
E2E Integration Unit Visit The Testing Pyramid @amirrustam
E2E Integration Unit Visit The Testing Pyramid Easy, developers really
like to write these. @amirrustam
E2E Integration Unit Visit The Testing Pyramid Easy, developers really
like to write these. More Difficult, costly, slower… Often completely ignored @amirrustam
E2E Integration Unit Visit The Testing Pyramid Best for users
& business @amirrustam
Renaissance of the Web 2005 2006 2014 2013 @amirrustam
Renaissance of the Web 2005 2006 2014 2013 More complexity
moved from backend to frontend. @amirrustam
2005 2006 2014 2013 Renaissance of the Web + Testing
Automation 2004 @amirrustam
Selenium Architecture Selenium Server Drivers Tests Python Javascript Java @amirrustam
Selenium Architecture Selenium Server Drivers Tests Python Javascript Java ⚠
Classical Syncing Dilemma @amirrustam
Selenium Architecture Flakiness Non-deterministic @amirrustam
✋ JSDOM or DOM Emulation JSDOM is not a real
browser. Your users don’t run your app with JSDOM. One of the primary reasons for E2E is to simulate real user actions. @amirrustam
Don’t let your users be your first E2E test. @amirrustam
Stateless Stateful @amirrustam
Fast, easy and reliable testing for anything that runs in
a browser. Free. Open Source. MIT License @amirrustam
$ npm install -D cypress ☝ All-in-one tool You get
everything you need ❤ Familiar tools underneath Mocha, Chia, Sinon @amirrustam
Lets see it in action…. @amirrustam https://github.com/cypress-io/cypress-example-todomvc
Cypress Architecture Browser Cypress Test Runner Your App @amirrustam
⚡ Native-access to the DOM and your app.
- Fast Test Runs @amirrustam
⏳ Automatic Waiting @amirrustam
Debuggability @amirrustam
Realtime Reloading @amirrustam
Flake-free, consistent, and reliable. @amirrustam
How are commands executed? 1 2 3 @amirrustam
⚙ Component Testing cypress-react-unit-testing vue angular angularjs hyper-app svelte cycle
@amirrustam https:!//github.com/bahmutov/cypress-vue-unit-test#test-adapters-for-other-frameworks
3 cypress open Great for everyday development workflow Cypress +
Editor Side-by-Side TDD Nirvana cypress run Testing in CI/CD Pipeline Headless More efficient for running all your tests @amirrustam
3 cypress open Great for everyday development workflow Cypress +
Editor Side-by-Side TDD Nirvana cypress run --record Video Recordings of Tests @amirrustam
Cypress Dashboard - Great for CI @amirrustam
cypress run --record --parallel Introducing Parallelization Now available in Cypress
3.1 @amirrustam
cypress run --parallel cypress run --parallel cypress run --parallel Your
CI Machines 3x parallelism Ready for work signup.spec.js login.spec.js widget.spec.js @amirrustam
Previous Spec Test Runs Spec Test Duration History Test Duration
(seconds) The Future Automatic Load Balancing of Test Specs Duration Forecast @amirrustam
Automatic Load Balancing of Test Specs login.spec.js signup.spec.js widget.spec.js @amirrustam
Cypress Parallelization Easily optimize your CI usage You save a
lot of ⏳ time and money @amirrustam
cypress run --group frontend Introducing Test Run Grouping Now available
in Cypress 3.1
Documentation docs.cypress.io
Best Practices docs.cypress.io @amirrustam
https:!//youtu.be/5XQOK0v_YRE Cypress Best Practices Brian Mann, Creator of Cypress
End to End testing with Cypress By Andrew Van Slaars
egghead.io/courses/end-to-end-testing-with-cypress
docs.cypress.io/examples/examples/tutorials.html Tutorial Videos
Testing Workshop docs.cypress.io/examples/examples/workshop.html
Podcasts docs.cypress.io/examples/media/podcasts-media.html
We are trying to drastically improve the status quo of
testing on the web. @amirrustam
Thank You npm install -D cypress Free. Open Source. MIT
License Follow @amirrustam for link to slides.