/cypress-example

Web test example with Cypress.io

Primary LanguageJavaScript

cypress-example

Web test example with Cypress.io

Easy setup for test development. Use NodeJS package manager for local installation. Or run it inside Docker container. Both ways the results can be viewed on local machine.

How to run test locally with Cypress runner

  1. Download runner package from https://www.cypress.io/
  2. Unzip
  3. Run it and give this folder as project root

How to run tests locally with NPM

  1. Create temporary folder for output called 'cypress'
  2. Use npm to build project
  3. Run test with npm
  4. Check ./cypress for the output files

Place your tests in ./tests/.

Commands

mkdir -p cypress
npm install
npm run cypress:run

How to run tests locally with Docker

  1. Create temporary folder for output called 'cypress'
  2. Use Docker to build project
  3. Run test with Docker
  4. Check ./cypress for the output files (if mounted)

Commands

#Build
docker build -t <cypress_container_name> .
#Run without mounting
docker run --rm <cypress_container_name>
#Run with mounting - output will be in cypress folder
docker run --rm -v $(pwd)/cypress:/usr/src/app/cypress <cypress_container_name>