From 1a1428ee9e161f6578dfc83f43308707d85bd703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatiana=20L=C3=A9piz=20Soto?= <94494491+tatilepizs@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:16:59 -0600 Subject: [PATCH] chore: add section to debug e2e tests (#1724) --- content/en/contribute/code/core/automated-tests.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/en/contribute/code/core/automated-tests.md b/content/en/contribute/code/core/automated-tests.md index a0cc544b0..05e875086 100644 --- a/content/en/contribute/code/core/automated-tests.md +++ b/content/en/contribute/code/core/automated-tests.md @@ -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.