gradido/e2e-tests
MateuszMichalowski 45f4207537
build(frontend): merged code from master (#3367)
* fix

* fix test

* update docker compose call

* update e2e test

* change docker-compose to docker compose in all workflows

* use mariadb container with enabled external_network

* add sleep to test_database

* add maybe new parameter --service-ports needed for docker compose run else there weren't any open ports

* try another approach

* save change (._.);

* fix(frontend): fix e2e setup & add additional check in validation rules.

* fix(frontend): fix e2e setup

---------

Co-authored-by: einhornimmond <info@einhornimmond.de>
Co-authored-by: einhornimmond <dario.rekowski@gmx.de>
2024-09-12 21:00:08 +02:00
..
2023-02-14 11:21:16 +01:00
2023-02-14 11:38:01 +01: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