Add wait for the 'Proceed' button to become active in shipping task

This commit is contained in:
Julia Amosova 2020-04-27 16:30:50 -04:00
parent 46bc16de98
commit b1bb4dfdb9
1 changed files with 1 additions and 11 deletions

View File

@ -70,17 +70,6 @@ describe( 'Store owner can go through setup Task List', () => {
const storeLocationFields = await page.$$( '.components-text-control__input' );
expect( storeLocationFields ).toHaveLength( 4 );
const countryAndStateField = '.woocommerce-select-control__control-input';
// 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( countryAndStateField, { text: config.get( 'addresses.admin.store.countryandstate' ) } ),
expect( page ).toMatchElement( storeLocationFields[2], { text: config.get( 'addresses.admin.store.city' ) } ),
expect( page ).toMatchElement( storeLocationFields[3], { 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
@ -88,6 +77,7 @@ describe( 'Store owner can go through setup Task List', () => {
// Wait for "Proceed" button to become active
await page.waitForSelector( 'button.is-primary:not(:disabled)' );
await page.waitFor( 3000 );
// Click on "Proceed" button to save shipping settings
await page.click( 'button.is-primary' );