From 3991647c949555d2de3250f087af909acea84f7c Mon Sep 17 00:00:00 2001 From: Julia Amosova Date: Mon, 27 Apr 2020 14:22:23 -0400 Subject: [PATCH] Add shipping store location verification step in onboarding e2e test --- .../activate-and-setup/setup-wizard.test.js | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js b/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js index 190d9a952aa..aecd1edf54f 100644 --- a/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js +++ b/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js @@ -66,10 +66,28 @@ describe( 'Store owner can go through setup Task List', () => { page.waitForNavigation( { waitUntil: 'networkidle0' } ), ] ); - // Wait for "Proceed" button to become active + // Query for store location fields + const storeLocationFields = await page.$$( '.components-text-control__input' ); + expect( storeLocationFields ).toHaveLength( 5 ); + + // Verify that store location is set + await Promise.all( [ + expect( page ).toMatchElement( storeLocationFields[0], { text: config.get( 'addresses.admin.store.addressfirstline' ) } ), + expect( page ).toMatchElement( storeLocationFields[1], { text: config.get( 'addresses.admin.store.addresssecondline' ) } ), + expect( page ).toMatchElement( storeLocationFields[2], { text: config.get( 'addresses.admin.store.countryandstate' ) } ), + expect( page ).toMatchElement( storeLocationFields[3], { text: config.get( 'addresses.admin.store.city' ) } ), + expect( page ).toMatchElement( storeLocationFields[4], { text: config.get( 'addresses.admin.store.postcode' ) } ), + ] ); + + // 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 "Complete task" button to become active await page.waitForSelector( 'button.is-primary:not(:disabled)' ); - // Click on "Proceed" button to save shipping settings + // Click on "Complete task" button to save shipping settings await page.click( 'button.is-primary' ); await page.waitFor( 3000 ); } );