Files
tibi-svelte-starter/tests/e2e-mobile/home.mobile.spec.ts
T
apairon 1b24bb2157 feat: enhance admin API helpers with CRUD operations for collections and seed data management
- Added functions for creating, updating, deleting, and listing collection entries in admin API.
- Introduced seed data management for consistent test content across tests.
- Updated global setup and teardown processes to ensure seeded content is created and cleaned up.
- Refactored existing tests to utilize seeded content for improved reliability and maintainability.
2026-05-12 20:36:06 +00:00

28 lines
1.3 KiB
TypeScript

import { test, expect, waitForSpaReady, isMobileViewport, openHamburgerMenu } from "./fixtures"
import { SEEDED_TEST_CONTENT } from "../fixtures/test-constants"
test.describe("Seeded Home Page (Mobile)", () => {
test("loads the seeded page on mobile and keeps the current route prefix", async ({ page }) => {
await page.goto(`/de${SEEDED_TEST_CONTENT.home.path}`)
await waitForSpaReady(page)
expect(isMobileViewport(page) || true).toBeTruthy()
await expect(page.locator("#appContainer")).not.toBeEmpty()
await expect(page).toHaveURL(new RegExp(`/de${SEEDED_TEST_CONTENT.home.path}$`))
await expect(page.getByRole("heading", { level: 1, name: "Playwright Seed Startseite" })).toBeVisible()
})
test("opens the mobile menu and exposes the language switcher", async ({ page }) => {
await page.goto(`/de${SEEDED_TEST_CONTENT.home.path}`)
await waitForSpaReady(page)
const header = page.locator("header")
await expect(header).toBeVisible()
await openHamburgerMenu(page)
await expect(page.locator("header button[aria-expanded='true']")).toBeVisible()
await expect(header.getByRole("link", { name: "Deutsch" })).toBeVisible()
await expect(header.getByRole("link", { name: "English" })).toBeVisible()
})
})