Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

test: wait for landing message focus animation before geometry checks (#1143)

Gustavo Ye3f8b09789df3
diff --git a/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts b/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
index 73d202305..732c7309c 100644
--- a/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
+++ b/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
@@ -359,7 +359,13 @@ test("landing gallery mobile playback keeps full-size readable messages", async
await motion.scrollIntoViewIfNeeded()
await expect.poll(async () => Number(await motion.getAttribute("data-beat"))).toBeGreaterThanOrEqual(3)
const paragraph = stage.locator('div[data-visible="true"] p:visible').first()
- const geometry = await paragraph.evaluate(element => {
+ const geometry = await paragraph.evaluate(async element => {
+ await new Promise<void>(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())))
+ const animations: Animation[] = []
+ for (let parent = element.parentElement; parent; parent = parent.parentElement) {
+ animations.push(...parent.getAnimations())
+ }
+ await Promise.all(animations.map(animation => animation.finished.catch(() => undefined)))
let scale = 1
for (let parent = element.parentElement; parent; parent = parent.parentElement) {
const transform = getComputedStyle(parent).transform