Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cypress workshop for JSFoo 2019

The slides contain the contents to be presented in JSFoo 2019, Coimbatore for Cypress workshop

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

  • Be the first to like this

Cypress workshop for JSFoo 2019

  1. 1. Write automation tests in your favourite language, javascript Shabareesh JL Biswajit Pattanayak
  2. 2. What is wrong with e2e tests? ● Developers hate e2e tests ● E2E tests are flaky ● E2E tests take long time to set up ● Limited debuggability ● Network traffic control
  3. 3. How cypress can solve this?
  4. 4. How it works and capabilities ● Runs in browser and in the same run loop as the application ● Taps the native browser apis and network proxy to modify the requests so as to avoid same-origin policy ● Realtime native access to the DOM ● Cypress commands are promise alike and are asynchronous in nature ● During execution all commands are enqueued in a global singleton object ● Automatic retry ability ● Can stub or spy network requests; hence useful to simulate failure conditions
  5. 5. Limitations ● Not completely open source; runs on a freemium model ● Supports only javascripts; no other language support possible ● Bound to same-origin policy ● Cross browser support is still being worked on ● Can’t run a multi tab test ● Remote execution is not possible ● If the app contains 3rd party iFrames, cypress can test those by disabling web security or through cy.request ● Performing tasks outside the browser are little cumbersome
  6. 6. How we exploited it to solve our problem
  7. 7. Hands-on Exercise ❖ write a simple cypress test to validate a user journey ❖ understand debugging, reporting in cypress ❖ make the test suite CI ready - setting up environment configuration, choosing browser, and recording tests ❖ stubbing in cypress to test edge cases ❖ use other important features of cypress such as making XHR request, using plugin, writing custom commands

×