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.
- Download runner package from https://www.cypress.io/
- Unzip
- Run it and give this folder as project root
- Create temporary folder for output called 'cypress'
- Use npm to build project
- Run test with npm
- Check
./cypress
for the output files
Place your tests in ./tests/
.
mkdir -p cypress
npm install
npm run cypress:run
- Create temporary folder for output called 'cypress'
- Use Docker to build project
- Run test with Docker
- Check
./cypress
for the output files (if mounted)
#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>