frontend/cypress
konrad efed128f03 fix: rely on api to properly sort tasks on home page (#1997)
This PR changes the behaviour of how tasks are sorted. Before, the frontend would sort tasks but this resulted in some cases where tasks were not sorted properly. Most of this is test code to reliably reproduce the problem and make fixing it easier.
The actual bug was in Vikunja's api, therefore I've removed all sorting of tasks in the frontend and ensured the api properly sorts tasks.

Fixes https://github.com/go-vikunja/frontend/issues/54

Depends on vikunja/api#1177

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/frontend#1997
Reviewed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
2022-06-01 16:59:59 +00:00
..
factories fix: replace faker with community fork faker-js/faker (#1408) 2022-01-20 07:54:39 +00:00
fixtures Frontend Testing With Cypress (#313) 2020-12-10 13:52:35 +00:00
integration fix: rely on api to properly sort tasks on home page (#1997) 2022-06-01 16:59:59 +00:00
plugins Frontend Testing With Cypress (#313) 2020-12-10 13:52:35 +00:00
support fix: rely on api to properly sort tasks on home page (#1997) 2022-06-01 16:59:59 +00:00
README.md chore: some small changes in the cypress README.md (#793) 2021-09-26 17:49:27 +00:00
docker-compose.yml chore: change cypress settings to run tests in cypress without needing to modify the config 2021-10-02 20:07:38 +02:00

README.md

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

yarn test:frontend

Using The Cypress Dashboard

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

yarn cypress:open