Skip to content

qualityshepherd/cypress-example

Repository files navigation

E2E Tests

Cypress Example

An example project using the automation tool, Cypress. These tests are quite silly but are intended to provide examples of common actions you may need in your testing. I've included:

  • page objects
  • various ways of running the tests (via npm scripts)

Rant

Cypress is an agressively opinionated framework... some of these opinions are at best, misguided :) YMMV. I know it's very popular... but honestly, I would avoid Cypress if you can. My issues with Cypress include:

  1. it hates on page objects
  2. it has a versioning problem: TONS of misinformation about how to use it on the internets
  3. it cannot handle new windows/tabs
  4. it can't handle multiple domains in one test file
  5. it requires learning a proprietary framework rather than learning to code
  6. it teaches some bad testing habits (eg. expects in page objects)
  7. it thinks conditionals in tests are ok; they're not
  8. it's slow
  9. anything it doesn't handle the docs will tell you YOU SHOULDN'T WANT TO DO THAT (eg. test if an element exists)
  10. I have yet to see anyone use it well

I strongly suggest using Testcafe or Playwright instead.

Requires

  1. node
  2. git

Setup

  1. clone: git@github.com:qualityshepherd/cypress-example.git
  2. install: npm i

Run Them Tests

  1. all'vum: npm test
  2. just homePage: npm run cy:home
  3. headless: npm run cy:headless

Test Run Gif

Releases

No releases published

Packages

No packages published