Fix failing visual test

This commit is contained in:
Przemek Więch
2026-07-01 13:08:11 +02:00
parent a1333932ac
commit c23d134e95

View File

@@ -8,6 +8,17 @@ test.describe('Intro page visual validation @visual', () => {
}); });
test('intro-page', async ({page}) => { test('intro-page', async ({page}) => {
// Wait for the async changelog content to load so React doesn't
// overwrite our placeholder after we inject it.
await page.waitForFunction(() => {
const headers = Array.from(document.querySelectorAll('h3'));
const whatsNew = headers.find((h) =>
h.textContent?.includes("What's new"),
);
const span = whatsNew?.nextElementSibling;
return span && span.innerHTML.trim() !== '';
});
// Clean dynamic elements right before snapping the screenshot. // Clean dynamic elements right before snapping the screenshot.
await page.evaluate(() => { await page.evaluate(() => {
// 1. Overwrite dynamic footer versioning. // 1. Overwrite dynamic footer versioning.