mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-12 15:25:49 +00:00
Gradido End-to-End Testing with Cypress (CI-ready via Docker)
A setup to show-case Cypress as an end-to-end testing tool for Gradido running in a Docker container. The tests are organized in feature files written in Gherkin syntax.
Features under test
So far these features are initially tested
Precondition
Before running the tests, change to the repo's root directory (gradido).
Boot up the system under test
docker-compose up
Seed the database
The database has to be seeded upfront to every test run.
# change to the backend directory
cd /path/to/gradido/gradido/backend
# install all dependencies
yarn
# seed the database (everytime before running the tests)
yarn seed
Execute the test
This setup will be integrated in the Gradido Github Actions to automatically support the CI/CD process. For now the test setup can only be used locally in two modes.
Run Cypress directly from the code
# change to the tests directory
cd /path/to/gradido/e2e-tests/
# install all dependencies
yarn install
# a) run the tests on command line
yarn cypress run
# b) open the Cypress GUI to run the tests in interactive mode
yarn cypress open
Run Cyprss from a separate Docker container
# change to the cypress directory
cd /path/to/gradido/e2e-tests/
# build a Docker image from the Dockerfile
docker build -t gradido_e2e-tests-cypress .
# run the Docker image and execute the given tests
docker run -it --network=host gradido_e2e-tests-cypress yarn cypress-e2e