Skip to content

Commit

Permalink
Fix: Use waitUntil instead of waitForLoadState in page.goto() (#3…
Browse files Browse the repository at this point in the history
…7831)

* 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>
  • Loading branch information
ravinderk and lanej0 committed Apr 19, 2023
1 parent 83e6b55 commit 2239270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/fix-36698
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Use waitUntil instead of waitForLoadState in page.goto() and page.click().
Expand Up @@ -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
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 2239270

Please sign in to comment.