Skip to content

binhdao112/cypress-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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's overly complex
  2. 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's slow
  8. anything it doesn't handle the docs will tell you YOU SHOULDN'T WANT TO DO THAT (eg. test if an element exists)
  9. it's a total pain to get it working on CI
  10. I have yet to see anyone use it well

I strongly suggest using Testcafe instead.

Requires

  1. node
  2. git

Setup

  1. clone: [email protected]: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

About

Example e2e tests using Cypress

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%