From ebafecea0fc669a24ac1f5e5e5f7ac2e0eff030b Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Thu, 23 Mar 2023 13:40:31 -0300 Subject: [PATCH] Reduce flakiness on E2E setup (#37410) * Reduce flakiness on test setup * Add changelog * Go to wp-admin --- plugins/woocommerce/changelog/e2e-setup-flakiness | 4 ++++ plugins/woocommerce/tests/e2e-pw/global-setup.js | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 plugins/woocommerce/changelog/e2e-setup-flakiness diff --git a/plugins/woocommerce/changelog/e2e-setup-flakiness b/plugins/woocommerce/changelog/e2e-setup-flakiness new file mode 100644 index 00000000000..d4cb783d5b0 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-setup-flakiness @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Reduce flakiness on E2E test setup. diff --git a/plugins/woocommerce/tests/e2e-pw/global-setup.js b/plugins/woocommerce/tests/e2e-pw/global-setup.js index ca20d995231..9b4673b1047 100644 --- a/plugins/woocommerce/tests/e2e-pw/global-setup.js +++ b/plugins/woocommerce/tests/e2e-pw/global-setup.js @@ -60,6 +60,8 @@ module.exports = async ( config ) => { await adminPage.fill( 'input[name="pwd"]', admin.password ); await adminPage.click( 'text=Log In' ); await adminPage.waitForLoadState( 'networkidle' ); + await adminPage.goto( `/wp-admin` ); + await adminPage.waitForLoadState( 'domcontentloaded' ); await expect( adminPage.locator( 'div.wrap > h1' ) ).toHaveText( 'Dashboard'