test(e2e): sample the delete dialog until it has enough frames (#28323)

* test(e2e): sample the delete dialog until it has a full frame floor

* test(e2e): drop the frame-count assertion the sampling loop now guarantees
This commit is contained in:
Jinwoo Hong
2026-10-13 10:30:37 -04:00
committed by GitHub
parent 41e6ea530a
commit f1d1a9b076
@@ -120,7 +120,8 @@ for (const scenario of ['single', 'children', 'batch', 'known-dirty'] as const)
confirmFocused: boolean
}[] = []
const started = performance.now()
while (performance.now() - started < 2400) {
// Why a frame floor too: a loaded runner paints fewer than 21 frames in 2.4 s.
while (performance.now() - started < 2400 || samples.length <= 20) {
const dialog = document.querySelector('[data-slot="dialog-content"]')
// Why not the last button: force delete is a split button whose menu chevron comes last.
const button = Array.from(
@@ -167,7 +168,6 @@ for (const scenario of ['single', 'children', 'batch', 'known-dirty'] as const)
}
await page.screenshot({ path: testInfo.outputPath('loaded.png') })
await dialog.screenshot({ path: testInfo.outputPath('loaded-dialog.png') })
expect(frames.length).toBeGreaterThan(20)
expect(frames[0]?.confirmFocused).toBe(true)
for (const frame of frames) {
expect(frame).toEqual(frames[0])