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)
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:
- it's overly complex
- TONS of misinformation about how to use it on the internets
- it cannot handle new windows/tabs
- it can't handle multiple domains in one test file
- it requires learning a proprietary framework rather than learning to code
- it teaches some bad testing habits (eg. expects in page objects)
- it's slow
- anything it doesn't handle the docs will tell you YOU SHOULDN'T WANT TO DO THAT (eg. test if an element exists)
- it's a total pain to get it working on CI
- I have yet to see anyone use it well
I strongly suggest using Testcafe instead.
- clone:
[email protected]:qualityshepherd/cypress-example.git
- install:
npm i
- all'vum:
npm test
- just homePage:
npm run cy:home
- headless:
npm run cy:headless