Improve the UI and tests

This commit is contained in:
Urtzi Alfaro
2025-11-15 21:21:06 +01:00
parent 86d704b354
commit 54b7a5e080
44 changed files with 2268 additions and 1414 deletions

View File

@@ -153,3 +153,25 @@ export async function isVisible(page: Page, selector: string): Promise<boolean>
return false;
}
}
/**
* Accepts cookie consent dialog if present
* Should be called after navigating to a page
*/
export async function acceptCookieConsent(page: Page) {
try {
const acceptButton = page.getByRole('button', {
name: /aceptar todas|accept all/i,
});
const isVisible = await acceptButton.isVisible({ timeout: 2000 }).catch(() => false);
if (isVisible) {
await acceptButton.click();
// Wait a bit for the dialog to close
await page.waitForTimeout(500);
}
} catch (error) {
// Cookie dialog not present, that's fine
}
}