diff --git a/changelog/dev-fix-e2e-tests-on-wc-7-7 b/changelog/dev-fix-e2e-tests-on-wc-7-7 new file mode 100644 index 00000000000..15b4d3b72e9 --- /dev/null +++ b/changelog/dev-fix-e2e-tests-on-wc-7-7 @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Fix e2e tests on WC 7.7. + + diff --git a/tests/e2e/specs/wcpay/shopper/shopper-multi-currency-widget.spec.js b/tests/e2e/specs/wcpay/shopper/shopper-multi-currency-widget.spec.js index 23aec018d59..3d3045c12a8 100644 --- a/tests/e2e/specs/wcpay/shopper/shopper-multi-currency-widget.spec.js +++ b/tests/e2e/specs/wcpay/shopper/shopper-multi-currency-widget.spec.js @@ -95,6 +95,7 @@ describe( 'Shopper Multi-Currency widget', () => { await setupTest(); await page.waitForSelector( '.widget select[name=currency]', { visible: true, + timeout: 5000, } ); await page.select( '.widget select[name=currency]', 'EUR' ); await expect( page.url() ).toContain( @@ -105,6 +106,7 @@ describe( 'Shopper Multi-Currency widget', () => { ); // Change it back to USD for the other tests. await page.select( '.widget select[name=currency]', 'USD' ); + await page.reload( { waitUntil: 'networkidle0' } ); } ); } ); @@ -178,5 +180,6 @@ describe( 'Shopper Multi-Currency widget', () => { '.widget select[name=currency]' ); expect( currencySwitcher ).toBeNull(); + await merchant.logout(); } ); } ); diff --git a/tests/e2e/utils/flows.js b/tests/e2e/utils/flows.js index aa18cd328a7..72461c8aea9 100644 --- a/tests/e2e/utils/flows.js +++ b/tests/e2e/utils/flows.js @@ -679,7 +679,11 @@ export const merchantWCP = { searchInput.type( 'switcher', { delay: 20 } ); await page.waitForSelector( - 'button.components-button[role="option"]' + 'button.components-button[role="option"]', + { + visible: true, + timeout: 5000, + } ); await page.click( 'button.components-button[role="option"]' ); await page.waitFor( 2000 ); @@ -699,7 +703,7 @@ export const merchantWCP = { await merchant.openNewOrder(); await page.click( 'button.add-line-item' ); await page.click( 'button.add-order-item' ); - await page.click( 'select.wc-product-search' ); + await page.click( 'select[name="item_id"]' ); await page.type( '.select2-search--dropdown > input', config.get( 'products.simple.name' ),