- [Cypress] (https://www.cypress.io/)
- [Allure] (https://docs.qameta.io/): reporting framework
-
Check out the relevant branch: E.g. if you are testing a 2.32.x version of DHIS2
$ git checkout v32
or, if you are testing a 2.38.x version of DHIS2
$ git checkout v38
-
Install dependencies:
$ yarn install
-
Set the environment
export CYPRESS_LOGIN_USERNAME=<dhis2_superuser> export CYPRESS_LOGIN_PASSWORD=<dhis2_superuser_password> export CYPRESS_BASE_URL=<instance_URL> # e.g. https://prep.dhis2.org/2.38dev/ ... see [Environment variables section](#environment-variables) for more configuration options
-
Adapt the tests to your environment: Some of the test feature files include references from the Sierra Leone demo DB. These should be replaced to suit your target DB
Check the following feature files and update the parameters in double-quotes ("
) accordingly:./cypress/e2e/capture.cy.js
-
Run the tests:
$ yarn run cy:test
or in parallel (using 3 threads):
$ yarn run cy:parallel
or only smoke tests:
$ export TAGS=smoke $ yarn run cy:test (or any other command)
Environment variable | Description | Required | Default value |
---|---|---|---|
CYPRESS_BASE_URL | URL of instance under test | true | smoke.dhis2.org/dev_smoke |
CYPRESS_LOGIN_USERNAME | username of user used in tests | true | admin |
CYPRESS_LOGIN_PASSWORD | password of user used in tests | true | district |
TAGS | filter tests matching specified tags | false |
Allure is the framework used to generate a test report. To generate and serve the report, run yarn run allure:serve
. The report should open in a browser window.