Added accessibility tests

This commit is contained in:
adilallo
2025-08-29 12:52:49 -06:00
parent f676f8ec24
commit 705cfed075
6 changed files with 606 additions and 11 deletions
+16 -9
View File
@@ -293,15 +293,22 @@ test.describe("Homepage", () => {
});
test("accessibility standards compliance", async ({ page }) => {
await runA11y(page, {
rules: {
"color-contrast": { enabled: true },
"heading-order": { enabled: true },
"landmark-one-main": { enabled: true },
"page-has-heading-one": { enabled: true },
region: { enabled: true },
},
});
// Basic accessibility checks
const html = page.locator("html");
const lang = await html.getAttribute("lang");
expect(lang).toBeTruthy();
// Check for main heading
const h1 = page.locator("h1").first();
await expect(h1).toBeVisible();
// Check for main landmark
const main = page.locator("main, [role='main']");
await expect(main).toBeVisible();
// Check for navigation
const nav = page.locator("nav, [role='navigation']").first();
await expect(nav).toBeVisible();
});
test("scroll behavior and smooth scrolling", async ({ page }) => {