From d129a980d922af2b47c4217b4168b5138ade277b Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 27 Aug 2021 11:12:13 -0300 Subject: [PATCH] reset onboarding on retest --- tests/e2e/config/jest.setup.js | 6 +++--- .../complete-onboarding-wizard.test.js | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/e2e/config/jest.setup.js b/tests/e2e/config/jest.setup.js index 59eb9da95b5..ebf80556653 100644 --- a/tests/e2e/config/jest.setup.js +++ b/tests/e2e/config/jest.setup.js @@ -5,13 +5,13 @@ import { WP_ADMIN_LOGIN } from '@woocommerce/e2e-utils'; -const config = require('config'); -const { HTTPClientFactory } = require('@woocommerce/api'); +const config = require( 'config' ); +const { HTTPClientFactory } = require( '@woocommerce/api' ); const { addConsoleSuppression, updateReadyPageStatus } = 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 -addConsoleSuppression( 'woocommerce_shared_settings' ); +addConsoleSuppression( 'woocommerce_shared_settings', false ); /** * Uses the WordPress API to delete all existing posts diff --git a/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js b/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js index 9713b5185a1..b9920ab7cbc 100644 --- a/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js +++ b/tests/e2e/specs/activate-and-setup/complete-onboarding-wizard.test.js @@ -2,6 +2,15 @@ const { testAdminOnboardingWizard, testSelectiveBundleWCPay, } = require( '@woocommerce/admin-e2e-tests' ); +const { + withRestApi, + IS_RETEST_MODE, +} = require( '@woocommerce/e2e-utils' ); + +// Reset onboarding profile when re-running tests on a site +if ( IS_RETEST_MODE ) { + withRestApi.resetOnboarding(); +} testAdminOnboardingWizard(); testSelectiveBundleWCPay();