Files
tibi-svelte-starter/tests/e2e/home.spec.ts
T
apairon e84b87ed16 feat: enhance accessibility with skip to main content button and improve navigation handling
🔧 fix: update navigation href resolution to include localized paths

🆕 feat: add new FeatureIcon component for feature boxes

🎨 style: improve styling for prose elements in richtext blocks

🛠️ refactor: streamline medialib image loading and caching logic

📦 chore: update mock data handling to support new medialib entries

🔄 chore: synchronize i18n initialization and locale management

📝 docs: update video tour descriptions to reflect recent changes
2026-05-12 13:55:32 +00:00

56 lines
1.7 KiB
TypeScript

import { test, expect, waitForSpaReady } from "./fixtures"
test.describe("Home Page", () => {
test("should load the start page", async ({ page }) => {
await page.goto("/de/")
const lang = await waitForSpaReady(page)
expect(lang).toBe("de")
})
test("should have a visible header with navigation", async ({ page }) => {
await page.goto("/de/")
await waitForSpaReady(page)
const header = page.locator("header")
await expect(header).toBeVisible()
const nav = header.locator("nav")
await expect(nav).toBeVisible()
})
test("should have language prefix in URL", async ({ page }) => {
await page.goto("/de/")
await waitForSpaReady(page)
expect(page.url()).toContain("/de")
})
test("should switch language to English", async ({ page }) => {
await page.goto("/de/")
await waitForSpaReady(page)
// Click on English language link
const enLink = page.locator('a[href*="/en"]').first()
if (await enLink.isVisible()) {
await enLink.click()
await page.waitForLoadState("domcontentloaded")
expect(page.url()).toContain("/en")
}
})
test("should allow skipping directly to main content", async ({ page }) => {
await page.goto("/de/")
await waitForSpaReady(page)
await page.keyboard.press("Tab")
const skipLink = page.getByRole("button", { name: "Zum Hauptinhalt springen" })
await expect(skipLink).toBeFocused()
await page.keyboard.press("Enter")
const mainContent = page.locator("main#main-content")
await expect(mainContent).toBeFocused()
await expect(page).toHaveURL(/#main-content$/)
})
})