mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: retry page-leak object count checks (#32794)
This commit is contained in:
parent
0b69b1370a
commit
dd91afa736
@ -83,9 +83,11 @@ test('click should not leak', async ({ page, browserName, toImpl }) => {
|
|||||||
expect(leakedJSHandles()).toBeFalsy();
|
expect(leakedJSHandles()).toBeFalsy();
|
||||||
|
|
||||||
if (browserName === 'chromium') {
|
if (browserName === 'chromium') {
|
||||||
|
await expect(async () => {
|
||||||
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
||||||
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
||||||
expect(counts.main + counts.utility).toBeLessThan(25);
|
expect(counts.main + counts.utility).toBeLessThan(25);
|
||||||
|
}).toPass();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -114,9 +116,11 @@ test('fill should not leak', async ({ page, mode, browserName, toImpl }) => {
|
|||||||
expect(leakedJSHandles()).toBeFalsy();
|
expect(leakedJSHandles()).toBeFalsy();
|
||||||
|
|
||||||
if (browserName === 'chromium') {
|
if (browserName === 'chromium') {
|
||||||
|
await expect(async () => {
|
||||||
const counts = await objectCounts(toImpl(page), 'HTMLInputElement');
|
const counts = await objectCounts(toImpl(page), 'HTMLInputElement');
|
||||||
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
||||||
expect(counts.main + counts.utility).toBeLessThan(25);
|
expect(counts.main + counts.utility).toBeLessThan(25);
|
||||||
|
}).toPass();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -144,9 +148,11 @@ test('expect should not leak', async ({ page, mode, browserName, toImpl }) => {
|
|||||||
expect(leakedJSHandles()).toBeFalsy();
|
expect(leakedJSHandles()).toBeFalsy();
|
||||||
|
|
||||||
if (browserName === 'chromium') {
|
if (browserName === 'chromium') {
|
||||||
|
await expect(async () => {
|
||||||
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
||||||
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
||||||
expect(counts.main + counts.utility).toBeLessThan(25);
|
expect(counts.main + counts.utility).toBeLessThan(25);
|
||||||
|
}).toPass();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -174,8 +180,10 @@ test('waitFor should not leak', async ({ page, mode, browserName, toImpl }) => {
|
|||||||
expect(leakedJSHandles()).toBeFalsy();
|
expect(leakedJSHandles()).toBeFalsy();
|
||||||
|
|
||||||
if (browserName === 'chromium') {
|
if (browserName === 'chromium') {
|
||||||
|
await expect(async () => {
|
||||||
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
const counts = await objectCounts(toImpl(page), 'HTMLButtonElement');
|
||||||
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
expect(counts.main + counts.utility).toBeGreaterThanOrEqual(2);
|
||||||
expect(counts.main + counts.utility).toBeLessThan(25);
|
expect(counts.main + counts.utility).toBeLessThan(25);
|
||||||
|
}).toPass();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user