mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-10-26 16:55:08 +00:00
test(web): ignore scroll-driven animations when waiting for settled layout
The model selector's clipped-text fade runs on a scroll timeline, which never finishes, so document-wide waits never settled.
This commit is contained in:
1 parent
ca575ff573
commit
bde671f984
2 files changed
+7
-4
No files matched your search
@@ -57,7 +57,8 @@ describe.skipIf(webSnapshotMode() === 'record')('web e2e: context details placem
|
||||
})
|
||||
await page.evaluate(async () => {
|
||||
await Promise.all(document.getAnimations()
|
||||
.filter(animation => animation.effect?.getComputedTiming().iterations !== Infinity)
|
||||
.filter(animation => animation.timeline === document.timeline
|
||||
&& animation.effect?.getComputedTiming().iterations !== Infinity)
|
||||
.map(animation => animation.finished.catch(() => undefined)))
|
||||
})
|
||||
await expect.poll(async () => {
|
||||
|
||||
@@ -169,13 +169,15 @@ function firstRecallPulse(page: Page): Promise<boolean> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait until nothing under the page is animating, so a probe measures the settled
|
||||
* layout instead of a frame of a column slide.
|
||||
* Wait until no time-based animation under the page is running, so a probe measures
|
||||
* the settled layout instead of a frame of a column slide. Scroll-driven animations
|
||||
* never finish and are ignored.
|
||||
* @param page - the page under test.
|
||||
*/
|
||||
async function settled(page: Page): Promise<void> {
|
||||
await expect.poll(() => page.evaluate(() => document.getAnimations()
|
||||
.every(animation => animation.playState === 'finished' || animation.playState === 'idle')),
|
||||
.every(animation => animation.timeline !== document.timeline
|
||||
|| animation.playState === 'finished' || animation.playState === 'idle')),
|
||||
{ timeout: 20_000 }).toBe(true)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user