OpenSlides/integration
Sean 85c0e50c21 Integration tests using cypress
Test client integration (client loads)
Test auth integration (client logs in)
Test backend integration (accept request)
  - broken
Test autoupdate integration (sends au to client)

Add manual cypress tests
Add dockered cypress tests

Add Readme
Add test execution to makefile
Add test execution to github-actions

TODO:
- Create user for tests
- flush db after every test
2021-09-16 17:16:51 +02:00
..
cypress Integration tests using cypress 2021-09-16 17:16:51 +02:00
cypress-docker.json Integration tests using cypress 2021-09-16 17:16:51 +02:00
cypress.json Integration tests using cypress 2021-09-16 17:16:51 +02:00
docker-compose.yml Integration tests using cypress 2021-09-16 17:16:51 +02:00
Dockerfile Integration tests using cypress 2021-09-16 17:16:51 +02:00
entrypoint.sh Integration tests using cypress 2021-09-16 17:16:51 +02:00
package-lock.json Integration tests using cypress 2021-09-16 17:16:51 +02:00
package.json Integration tests using cypress 2021-09-16 17:16:51 +02:00
README.md Integration tests using cypress 2021-09-16 17:16:51 +02:00

Integration tests

To test the integration of our OpenSlides services we are using cypress. There are not too many of them, but they are sufficient tell that our services are properly integrated.

  • The client can be accessed
  • Authentication works (admin admin can be logged in)
  • The backend accepts requests (of some sort)
  • The auto update transmits data to the client

(this list is not exhaustive)

Writing tests and using cypress

To write and execute tests meaningfully, you will want to install cypress locally. Inside the /integration directory, execute

$ npm install
$ npm run cypress:open
(or `make cypress-open` from the main directory) 

The cypress runner will open using electron and executes the tests for you.

Run in docker and CI

Start OpenSlides (Usually in dev setup). From the main directory run

$ make run-dev

in the /integration just fire

$ docker-compose build
$ docker-compose up
(or `make cypress-docker` from the main directory)

Cypress will run dockered and report errors inside the CLI. Screenshots and videos of the tests can be found in the /integration/results folder.

You can streamline the whole process by using

$ make run-system-tests

From the main directory. This can take while, since the docker of OS4 has to be build first.