diff --git a/packages/js/e2e-environment/src/setup/jest.setup.js b/packages/js/e2e-environment/src/setup/jest.setup.js index 2481a9b5771..ffaa81910da 100644 --- a/packages/js/e2e-environment/src/setup/jest.setup.js +++ b/packages/js/e2e-environment/src/setup/jest.setup.js @@ -9,6 +9,7 @@ import { setBrowserViewport, } from '@wordpress/e2e-test-utils'; import { consoleShouldSuppress, addConsoleSuppression } from '../../utils'; +import { setupJestRetries } from '../../config/jest-object.config'; /** * Array of page event tuples of [ eventName, handler ]. @@ -175,6 +176,7 @@ beforeAll( async () => { capturePageEventsForTearDown(); enablePageDialogAccept(); observeConsoleLogging(); + setupJestRetries( 2 ); } ); afterEach( async () => { diff --git a/plugins/woocommerce/tests/e2e/config/jest.setup.js b/plugins/woocommerce/tests/e2e/config/jest.setup.js index 05dda4bb8f3..4a4feee45f2 100644 --- a/plugins/woocommerce/tests/e2e/config/jest.setup.js +++ b/plugins/woocommerce/tests/e2e/config/jest.setup.js @@ -7,7 +7,7 @@ import { const config = require( 'config' ); const { HTTPClientFactory } = require( '@woocommerce/api' ); -const { addConsoleSuppression, updateReadyPageStatus, setupJestObject } = require( '@woocommerce/e2e-environment' ); +const { addConsoleSuppression, updateReadyPageStatus, setupJestRetries } = require( '@woocommerce/e2e-environment' ); const { DEFAULT_TIMEOUT_OVERRIDE } = process.env; // @todo: remove this once https://github.com/woocommerce/woocommerce-admin/issues/6992 has been addressed @@ -40,7 +40,7 @@ async function trashExistingPosts() { // each other's side-effects. beforeAll(async () => { - setupJestObject(); + setupJestRetries( 2 ); if ( DEFAULT_TIMEOUT_OVERRIDE ) { page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );