vikunja-frontend/cypress
kolaente 1bbdd3b117
Merge branch 'main' into feature/ganttastic
# Conflicts:
#	pnpm-lock.yaml
#	src/components/tasks/gantt-component.vue
2022-10-02 00:24:10 +02:00
..
e2e Merge branch 'main' into feature/ganttastic 2022-10-02 00:24:10 +02:00
factories fix(tests): correctly set task position in cypress test fixtures 2022-07-13 17:00:38 +02:00
fixtures Frontend Testing With Cypress (#313) 2020-12-10 13:52:35 +00:00
support fix: cypress plugins 2022-07-04 21:50:48 +00:00
docker-compose.yml chore: align docker cypress image version with drone 2022-09-05 17:43:56 +02:00
README.md feat: use pnpm 2022-09-21 17:29:36 +02:00
tsconfig.json feat: setup cypress 2022-07-04 21:50:48 +00:00

Frontend Testing With Cypress

Setup

  • Enable the seeder api endpoint. You'll then need to add the testingtoken in cypress.json or set the CYPRESS_TEST_SECRET environment variable.
  • Basic configuration happens in the cypress.json file
  • Overridable with env
  • Override base url with CYPRESS_BASE_URL

Fixtures

We're using the test endpoint of the vikunja api to seed the database with test data before running the tests. This ensures better reproducability of tests.

Running The Tests Locally

Using Docker

The easiest way to run all frontend tests locally is by using the docker-compose file in this repository. It uses the same configuration as the CI.

To use it, run

docker-compose up -d

Then, once all containers are started, run

docker-compose run cypress bash

to get a shell inside the cypress container. In that shell you can then execute the tests with

pnpm run test:frontend

Using The Cypress Dashboard

To open the Cypress Dashboard and run tests from there, run

pnpm run cypress:open