From af2f080eb6b37cf6f7b17564e31aec6e2a577698 Mon Sep 17 00:00:00 2001 From: Raluca Stan Date: Wed, 12 May 2021 17:36:55 +0200 Subject: [PATCH] Fix waitForNavigation --- tests/e2e/specs/frontend/cart.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/specs/frontend/cart.test.js b/tests/e2e/specs/frontend/cart.test.js index 6289a224480..eb6ee89510d 100644 --- a/tests/e2e/specs/frontend/cart.test.js +++ b/tests/e2e/specs/frontend/cart.test.js @@ -130,10 +130,11 @@ describe( `${ block.name } Block (frontend)`, () => { // This is to ensure we've clicked the right cart button. expect( selectedValue ).toBeGreaterThan( 1 ); - await scrollTo( '.wc-block-cart__submit-button' ); - await page.click( '.wc-block-cart__submit-button' ); - await page.waitForNavigation(); + await Promise.all( [ + page.waitForNavigation(), + page.click( '.wc-block-cart__submit-button' ), + ] ); await page.waitForSelector( '.wc-block-checkout' ); await page.goBack( { waitUntil: 'networkidle0' } );