Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] networkidle for "idle after action" #2515

Closed
arjunattam opened this issue Jun 9, 2020 · 1 comment
Closed

[Feature] networkidle for "idle after action" #2515

arjunattam opened this issue Jun 9, 2020 · 1 comment
Assignees

Comments

@arjunattam
Copy link
Contributor

arjunattam commented Jun 9, 2020

Context:

  • Playwright Version: 1.0.2
  • Operating System: Ubuntu (GitHub Actions)
  • Browser: Tried Chromium and WebKit

Code Snippet

await page.goto('https://brewredis-spring-storefront.azuremicroservices.io/');
await page.fill('[placeholder=Search]', 'ipa');
page.on('response', (response) => {console.log('response event', response.url())});
await Promise.all([
  page.keyboard.press('Enter'),
  page.waitForSelector('mat-card-title')
]);
await page.waitForLoadState('networkidle');
console.log('networkidle');
await page.screenshot({ path: '__tests__/artifacts/search.png' });

On the page,

  • I search for a string "ipa"
  • Pressing enter loads the search results (shown as result cards on the UI)
  • Each result has a corresponding image

I was expecting the page.waitForLoadState to wait for the network calls that fetch images. But I'm seeing cases (only on CI) where this is not happening.

The end screenshot looks like the following, without the images being loaded.

search

@arjunattam arjunattam changed the title [BUG] networkidle seems to flake on CI [Feature] networkidle for "idle after action" Jun 10, 2020
@dgozman
Copy link
Contributor

dgozman commented Nov 9, 2020

We do not currently plan to enhance networkidle support, because it's quite flaky - any analytics script can mess it up.

However, here is a gist that does "wait for network settled after action", just in case it is still useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants