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
+18 -12
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");
const color = await page await waitFor(async () => {
.locator<HTMLHeadingElement>("h1") const color = await page
.evaluate((el) => { .locator<HTMLHeadingElement>("h1")
return globalThis.getComputedStyle(el).color; .evaluate((el) => {
}); return globalThis.getComputedStyle(el).color;
expect(color).toEqual("rgb(255, 0, 0)"); });
expect(color).toEqual("rgb(255, 0, 0)");
return true;
});
const textColor = await page await waitFor(async () => {
.locator<HTMLParagraphElement>("p") const textColor = await page
.evaluate((el) => { .locator<HTMLParagraphElement>("p")
return globalThis.getComputedStyle(el).color; .evaluate((el) => {
}); return globalThis.getComputedStyle(el).color;
expect(textColor).toEqual("rgb(0, 128, 0)"); });
expect(textColor).toEqual("rgb(0, 128, 0)");
return true;
});
}); });
}, },
}); });