chore: make less test less flaky (#3417)

This commit is contained in:
Marvin Hagemeister
2025-09-12 18:22:21 +02:00
committed by GitHub
parent ae3db58a99
commit 3ff4ec2ccb
+6
View File
@@ -2347,19 +2347,25 @@ Deno.test({
assertMetaContent(doc, "og:foo", "og value foo"); assertMetaContent(doc, "og:foo", "og value foo");
assertMetaContent(doc, "og:bar", "og value bar"); assertMetaContent(doc, "og:bar", "og value bar");
await waitFor(async () => {
const color = await page const color = await page
.locator<HTMLHeadingElement>("h1") .locator<HTMLHeadingElement>("h1")
.evaluate((el) => { .evaluate((el) => {
return globalThis.getComputedStyle(el).color; return globalThis.getComputedStyle(el).color;
}); });
expect(color).toEqual("rgb(255, 0, 0)"); expect(color).toEqual("rgb(255, 0, 0)");
return true;
});
await waitFor(async () => {
const textColor = await page const textColor = await page
.locator<HTMLParagraphElement>("p") .locator<HTMLParagraphElement>("p")
.evaluate((el) => { .evaluate((el) => {
return globalThis.getComputedStyle(el).color; return globalThis.getComputedStyle(el).color;
}); });
expect(textColor).toEqual("rgb(0, 128, 0)"); expect(textColor).toEqual("rgb(0, 128, 0)");
return true;
});
}); });
}, },
}); });