Context:
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 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.

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.
Most helpful comment
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.