Advertisement
Advertisement

More Related Content

Slideshows for you(20)

Advertisement

Cypress workshop for JSFoo 2019

  1. Write automation tests in your favourite language, javascript Shabareesh JL Biswajit Pattanayak
  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. How cypress can solve this?
  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. 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. How we exploited it to solve our problem
  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
Advertisement