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' );