Added jest object setup
This commit is contained in:
parent
35286bbbe6
commit
0d2b20b309
|
@ -7,8 +7,8 @@ import {
|
||||||
|
|
||||||
const config = require( 'config' );
|
const config = require( 'config' );
|
||||||
const { HTTPClientFactory } = require( '@woocommerce/api' );
|
const { HTTPClientFactory } = require( '@woocommerce/api' );
|
||||||
const { addConsoleSuppression, updateReadyPageStatus } = require( '@woocommerce/e2e-environment' );
|
const { addConsoleSuppression, updateReadyPageStatus, setupJestObject } = require( '@woocommerce/e2e-environment' );
|
||||||
const { DEFAULT_TIMEOUT_OVERRIDE, E2E_RETRY_TIMES } = process.env;
|
const { DEFAULT_TIMEOUT_OVERRIDE } = process.env;
|
||||||
|
|
||||||
// @todo: remove this once https://github.com/woocommerce/woocommerce-admin/issues/6992 has been addressed
|
// @todo: remove this once https://github.com/woocommerce/woocommerce-admin/issues/6992 has been addressed
|
||||||
addConsoleSuppression( 'woocommerce_shared_settings', false );
|
addConsoleSuppression( 'woocommerce_shared_settings', false );
|
||||||
|
@ -40,7 +40,7 @@ async function trashExistingPosts() {
|
||||||
// each other's side-effects.
|
// each other's side-effects.
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
|
||||||
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : 3;
|
setupJestObject();
|
||||||
|
|
||||||
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
|
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
|
||||||
page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );
|
page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );
|
||||||
|
@ -64,9 +64,6 @@ beforeAll(async () => {
|
||||||
width: 1280,
|
width: 1280,
|
||||||
height: 800,
|
height: 800,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set how many times to retry failed tests.
|
|
||||||
jest.retryTimes( retryTimes );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clear browser cookies and cache using DevTools.
|
// Clear browser cookies and cache using DevTools.
|
||||||
|
|
Loading…
Reference in New Issue