Fix: Use `waitUntil` instead of `waitForLoadState` in page.goto() (#37831)

* fix: use correct argument in playwright test

use waitUntil instead of waitForLoadState.

* chore: add log for change

* chore: revert changes in e2e test

* Update analytics-overview.spec.js

Remove waits, failing on CI

---------

Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
This commit is contained in:
Ravinder Kumar 2023-04-20 04:54:25 +05:30 committed by GitHub
parent 83e6b55642
commit 2239270edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Use waitUntil instead of waitForLoadState in page.goto() and page.click().

View File

@ -6,8 +6,7 @@ test.describe( 'Analytics pages', () => {
test.afterEach( async ( { page } ) => {
// do some cleanup after each test to make sure things are where they should be
await page.goto(
'wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview',
{ waitForLoadState: 'networkidle' }
'wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview'
);
// Grab all of the section headings
@ -52,8 +51,7 @@ test.describe( 'Analytics pages', () => {
// Create an array of the sections we're expecting to find.
const arrExpectedSections = [ 'Charts', 'Leaderboards', 'Performance' ];
await page.goto(
'wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview',
{ waitForLoadState: 'networkidle' }
'wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview'
);
for ( const expectedSection of arrExpectedSections ) {