diff --git a/docs/source/development.rst b/docs/source/development.rst index 9dafabe4..bd76b894 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -4,5 +4,6 @@ Development .. toctree:: :maxdepth: 4 - development.quick_environment.rst + development.quick_environment.md + development.testing.md modules diff --git a/docs/source/development.testing.md b/docs/source/development.testing.md new file mode 100644 index 00000000..958e5e83 --- /dev/null +++ b/docs/source/development.testing.md @@ -0,0 +1,29 @@ +# Testing + +All tests require an active setup of the Data Tracker via docker-compose and test data in the database (See [System for development](development.quick_environment.md)) + +Most tests are not deterministic and do not restore the state of the db afterwards. + +## Backend + +The tests are found in `backend/tests`. Use the same `venv` used to add data to the database. + +From the root of the repository: + +``` +PYTHONPATH=backend pytest backend +``` + +## Frontend + +Frontend testing is implemented using the end-to-end testing solution Nightwatch. + +Go to `test/nighwatch` and run `yarn install` to install the required packages. + +Nightwatch can use multiple different browsers, but the tests have only been confirmed to work with Chrome. + +To run the tests (in the `test/nighwatch` folder): + +``` +npx nightwatch collection.js --env chrome +```