mirror of
https://github.com/OHTU-German-learning-website/OHTU-German-learning-website.git
synced 2026-10-12 19:13:51 +03:00
31 lines
919 B
JavaScript
31 lines
919 B
JavaScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("Global header search", () => {
|
|
test("should search and navigate to a page result", async ({ page }) => {
|
|
test.setTimeout(60000);
|
|
|
|
await page.goto("");
|
|
await expect(page.getByLabel("Suche")).toBeVisible();
|
|
|
|
const searchInput = page.getByLabel("Suche");
|
|
await searchInput.fill("Glossar");
|
|
|
|
await expect(page.locator(".navbar-search-dropdown")).toBeVisible();
|
|
|
|
const resultButton = page
|
|
.locator(".navbar-search-item", {
|
|
has: page.locator(".navbar-search-item-title", { hasText: "Glossar" }),
|
|
})
|
|
.first();
|
|
|
|
await expect(resultButton).toBeVisible();
|
|
await expect(
|
|
resultButton.locator(".navbar-search-highlight").first()
|
|
).toBeVisible();
|
|
|
|
await resultButton.click();
|
|
await expect(page).toHaveURL(/\/glossary$/);
|
|
await expect(page.locator("main")).toBeVisible();
|
|
});
|
|
});
|