1b24bb2157
- 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.
28 lines
1.3 KiB
TypeScript
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()
|
|
})
|
|
})
|