playwright/test/assets/networkidle.js
Dmitry Gozman 5c1149f954
test: try to unflake network idle tests (#4333)
I think that we are too slow to fire the second fetch during 500ms,
and so network idle happens prematurely.

The fix is to manually trigger the second fetch early enough.
2020-11-04 07:35:19 -08:00

13 lines
314 B
JavaScript

async function main() {
window.ws = new WebSocket('ws://localhost:' + window.location.port + '/ws');
window.ws.addEventListener('message', message => {});
fetch('fetch-request-a.js');
window.top.fetchSecond = () => {
// Do not return the promise here.
fetch('fetch-request-b.js');
};
}
main();