Testing - uw-it-aca/myuw Wiki

Testing with Docker/Node

A Docker container is included in the project aimed at providing a test environment for testing the Django/Python code as well as the Javascript code. The following commands can be used to run specific tests:

$ docker-compose -f docker-compose.dev.yml run python-test
$ docker-compose -f docker-compose.dev.yml run jest

You can also run Linting tests using the following:

$ docker-compose -f docker-compose.dev.yml run eslint --fix
$ docker-compose -f docker-compose.dev.yml run eslint

Testing with Cypress

Cypress is end to end testing framework that will allow you to test the various UI components with real mock data.

Headless

Run in myuw project root docker-compose -f docker-compose.dev.yml run cypress It will output a video of each test inside cypress/videos

You will need to rebuild the cypress test container if any of the following files are modified:

  1. package.json
  2. Docker.cypress

You can do so with docker-compose -f docker-compose.dev.yml build cypress

With GUI (not recommended over SSH)

Run the following inside myuw project root:

  1. npm install .
  2. npx cypress open-ct

This will open the Cypress GUI and allow you to run the tests and see them running in a browser.

It will output a video of each test suite inside myuw/cypress/videos

It will output screenshots of any errors/failing tests it encountered inside myuw/cypress/screenshots