diff --git a/tests/e2e/env/config/default.json b/tests/e2e/env/config/default.json index 13c4c230c8c..19693eece88 100644 --- a/tests/e2e/env/config/default.json +++ b/tests/e2e/env/config/default.json @@ -27,7 +27,7 @@ "country": "United States (US)", "addressfirstline": "addr 1", "addresssecondline": "addr 2", - "countryandstate": "United States (US) -- California", + "countryandstate": "United States (US) — California", "city": "San Francisco", "state": "CA", "postcode": "94107" diff --git a/tests/e2e/specs/activate-and-setup/setup-wizard.test.js b/tests/e2e/specs/activate-and-setup/setup-wizard.test.js index c8770c7ba66..cb0a8205336 100644 --- a/tests/e2e/specs/activate-and-setup/setup-wizard.test.js +++ b/tests/e2e/specs/activate-and-setup/setup-wizard.test.js @@ -6,20 +6,17 @@ * Internal dependencies */ import { StoreOwnerFlow } from '../../utils/flows'; -import { completeOldSetupWizard, completeOnboardingWizard } from '../../utils/components'; +import { completeOnboardingWizard } from '../../utils/components'; import { permalinkSettingsPageSaveChanges, setCheckbox, settingsPageSaveChanges, verifyCheckboxIsSet, - verifyCheckboxIsUnset, verifyValueOfInputField + verifyValueOfInputField } from '../../utils'; -const config = require( 'config' ); - describe( 'Store owner can login and make sure WooCommerce is activated', () => { - - it( 'can login', async () => { + beforeAll( async () => { await StoreOwnerFlow.login(); } ); @@ -56,25 +53,16 @@ describe( 'Store owner can go through setup Task List', () => { it( 'can setup shipping', async () => { // Query for all tasks on the list const taskListItems = await page.$$( '.woocommerce-list__item-title' ); - expect( taskListItems ).toHaveLength( 5 ); + expect( taskListItems ).toHaveLength( 6 ); await Promise.all( [ // Click on "Set up shipping" task to move to the next step - taskListItems[2].click(), + taskListItems[3].click(), // Wait for shipping setup section to load page.waitForNavigation( { waitUntil: 'networkidle0' } ), ] ); - // Query for store location fields - const storeLocationFields = await page.$$( '.components-text-control__input' ); - expect( storeLocationFields ).toHaveLength( 4 ); - - // Wait for "Continue" button to become active - await page.waitForSelector( 'button.is-primary:not(:disabled)' ); - // Click on "Continue" button to move to the shipping cost section - await page.click( 'button.is-primary' ); - // Wait for "Proceed" button to become active await page.waitForSelector( 'button.is-primary:not(:disabled)' ); await page.waitFor( 3000 ); diff --git a/tests/e2e/utils/components.js b/tests/e2e/utils/components.js index 06a7d4a87f2..37b0e99e080 100644 --- a/tests/e2e/utils/components.js +++ b/tests/e2e/utils/components.js @@ -121,11 +121,11 @@ const completeOnboardingWizard = async () => { } // Wait for "Continue" button to become active - await page.waitForSelector( 'button.woocommerce-profile-wizard__continue:not(:disabled)' ); + await page.waitForSelector( 'button.is-primary:not(:disabled)' ); await Promise.all( [ // Click on "Continue" button to move to the next step - page.click( 'button.woocommerce-profile-wizard__continue' ), + page.click( 'button.is-primary' ), // Wait for "Tell us about your business" section to load page.waitForNavigation( { waitUntil: 'networkidle0' } ), @@ -186,9 +186,9 @@ const completeOnboardingWizard = async () => { await page.waitForSelector( '.woocommerce-profile-wizard__header-title' ); // Wait for "No thanks" button to become active - await page.waitForSelector( 'button.is-default:not(:disabled)' ); + await page.waitForSelector( 'button.is-secondary:not(:disabled)' ); // Click on "No thanks" button to move to the next step - await page.click( 'button.is-default' ); + await page.click( 'button.is-secondary' ); // End of onboarding wizard