mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: make debug info test less flaky (#11861)
This commit is contained in:
parent
bfa435a57e
commit
85d97b0cc7
@ -15,6 +15,21 @@ describe('DebugInfo', function () {
|
|||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
const {page, browser} = await getTestState();
|
const {page, browser} = await getTestState();
|
||||||
|
|
||||||
|
for (let i = 0; i < 5; i++) {
|
||||||
|
if (!browser.debugInfo.pendingProtocolErrors.length) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
await new Promise(resolve => {
|
||||||
|
return setTimeout(resolve, 200);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (browser.debugInfo.pendingProtocolErrors.length) {
|
||||||
|
throw new Error(
|
||||||
|
'browser.debugInfo.pendingProtocolErrors is not empty before the test'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const promise = page.evaluate(() => {
|
const promise = page.evaluate(() => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// @ts-expect-error another context
|
// @ts-expect-error another context
|
||||||
|
Loading…
Reference in New Issue
Block a user