From 1f14d557dd79d0fb4857cb54bcaa5c6dcc50f914 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 8 Dec 2021 13:59:10 -0500 Subject: [PATCH] Updated README.md with jest retry documentation --- packages/js/e2e-environment/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/js/e2e-environment/README.md b/packages/js/e2e-environment/README.md index 26752959fba..85a2e0a76a9 100644 --- a/packages/js/e2e-environment/README.md +++ b/packages/js/e2e-environment/README.md @@ -71,6 +71,20 @@ module.exports = jestConfig; **NOTE:** Your project's Jest config file is: `tests/e2e/config/jest.config.js`. +### The Jest Object + +The E2E environment has the following methods to let us control Jest's overall behavior. + +| Function | Parameters | Description | +|-----------|-------------|--------------| +| `setupJestRetries` | `retries` | Sets the amount of retries on failed tests + +**NOTE:** The amount of times failed tests are retried can also be set using the `E2E_RETRY_TIMES` environment variable when executing tests. This can be done using the command below: + +``` +E2E_RETRY_TIMES=2 pnpx wc-e2e test:e2e +``` + #### Test Screenshots The test sequencer provides a screenshot function for test failures. To enable screenshots on test failure use