1 of 8

Cypress E2E Testing

https://www.cypress.io/

Steve Schwarz

@steveaschwarz

2 of 8

End to End Testing

“Testing as the user” using the UI/interface and the “real” stack of services.

Useful, but often slow, and difficult to generate errors

Cypress supports faster E2E and also “sliding down” the testing pyramid

Cypress gives devs access to all of the browser environment in which site/app runs.

3 of 8

Why I like Cypress

  • Open source with paid premium service
  • Tests run in browser/doesn’t use Selenium
  • One step install: npm install -d cypress
  • Fantastic documentation!
  • Bundles: mocha/chai/sinon/lodash/moment/jQuery
  • No “flake”. Automatically waits for DOM/XHR
  • Graphical playback/debugging in browser
  • Validate/stub network/XHR requests

4 of 8

Let’s Test!

We’ll use my Agility Course Master Ionic Hybrid Angular application (https://agilitycoursemaster.com) as our system under test.

  1. Install Cypress
  2. Start application under test
  3. Create spec file(s)
  4. Run Cypress
  5. Select spec(s)
  6. Tests re-run automatically as specs change

5 of 8

6 of 8

Trade Offs

https://docs.cypress.io/guides/references/trade-offs.html

7 of 8

More Cypress Presentations

8 of 8

Thanks!