From 7ecdd503654978b57cd9fcc2ad6e0196fb604021 Mon Sep 17 00:00:00 2001 From: rodelgc Date: Tue, 3 Jan 2023 20:42:47 +0000 Subject: [PATCH] E2e/fix obw industry spec (#36260) * Fix 'can save industry changes' test * Add changelog * Wait store details contents to load --- plugins/woocommerce/changelog/e2e-fix-obw-industry-spec | 4 ++++ .../activate-and-setup/complete-onboarding-wizard.spec.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/e2e-fix-obw-industry-spec diff --git a/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec b/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec new file mode 100644 index 00000000000..734416dfad8 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Fix flakiness of the `can save industry changes when navigating back to "Store Details"` E2E test. diff --git a/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js index 6aad523cb38..6fe61713ae1 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js @@ -27,6 +27,10 @@ test.describe( 'Store owner can complete onboarding wizard', () => { storeDetails.us.expectedIndustries ); await page.click( 'button >> text=Continue' ); + await expect( page ).toHaveURL( /.*step=product-types/ ); + await expect( + page.locator( '.product-types button >> text=Continue' ) + ).toBeVisible(); } ); // eslint-disable-next-line jest/expect-expect @@ -41,8 +45,8 @@ test.describe( 'Store owner can complete onboarding wizard', () => { // Navigate back to "Store Details" section await page.click( 'button >> text=Store Details' ); - await onboarding.handleSaveChangesModal( page, { saveChanges: true } ); + await page.locator( 'text="Welcome to WooCommerce"' ).waitFor(); // Navigate back to "Industry" section await page.click( 'button >> text=Industry' );