Skip to content

Commit

Permalink
chore: add section to debug e2e tests (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatilepizs authored Nov 29, 2024
1 parent 4ba4782 commit 1a1428e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions content/en/contribute/code/core/automated-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ Setting the `DEBUG` environment variable (e.g. [`DEBUG=true npm run wdio-local`]
- Prevent Mocha from automatically retrying tests that fail (by default a failing test is retried 5 times, details in the [`wdio.conf`](https://github.com/medic/cht-core/blob/master/tests/wdio.conf.js#L198)file)
- Prevent the `cht-e2e` Docker containers from being torn down after the test finishes

#### Run the e2e tests without re-building docker images

After the tests are executed the first time using the command `npm run wdio-local`, the docker images are built in your local environment using the checkout branch name. If it is needed to run the tests repeatedly and there is a certainty that the cht-core code didn't change, you can use the command `npm run ci-webdriver-default`. This command will execute the e2e tests as they are run with the `wdio-local` command but without re-building the images. This command uses the images that were built previously, which makes the process faster.

#### Read the logs

Read the failure carefully - it often has really good info but sometimes it's just hard to find. Most importantly it tells you exactly the line in the test that failed and you can look that up in the source to see what it was trying to do. The error message itself is also really useful. Also sometimes one error causes the next, so always start with the first test failure before looking at the others.
Expand Down

0 comments on commit 1a1428e

Please sign in to comment.