feat(T02): Static pages – home, referenzen, kontakt, legal (impressum/datenschutz/agb)

This commit is contained in:
Implementation Engineer
2026-07-10 01:02:27 +02:00
parent e9da21b57e
commit db5080df48
15 changed files with 1618 additions and 109 deletions
+74
View File
@@ -0,0 +1,74 @@
import { test, expect } from "@playwright/test";
test.describe("Kontakt Page", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/kontakt");
});
test("should display contact page heading", async ({ page }) => {
await expect(page.locator('[data-testid="kontakt-headline"]')).toContainText("Kontakt");
});
test("should show office address card", async ({ page }) => {
const card = page.locator('[data-testid="office-card"]');
await expect(card).toBeVisible();
await expect(card).toContainText("Grockelhofen 10");
await expect(card).toContainText("89340 Leipheim");
});
test("should show warehouse address card", async ({ page }) => {
const card = page.locator('[data-testid="warehouse-card"]');
await expect(card).toBeVisible();
await expect(card).toContainText("Ellzee");
});
test("should show opening hours card", async ({ page }) => {
const card = page.locator('[data-testid="hours-card"]');
await expect(card).toBeVisible();
await expect(card).toContainText("Öffnungszeiten");
});
test("should show 2 contact persons", async ({ page }) => {
await expect(page.locator('[data-testid="contact-person-markus"]')).toBeVisible();
await expect(page.locator('[data-testid="contact-person-thomas"]')).toBeVisible();
});
test("should have form with all required fields", async ({ page }) => {
await expect(page.locator('[data-testid="form-name"]')).toBeVisible();
await expect(page.locator('[data-testid="form-email"]')).toBeVisible();
await expect(page.locator('[data-testid="form-phone"]')).toBeVisible();
await expect(page.locator('[data-testid="form-message"]')).toBeVisible();
await expect(page.locator('[data-testid="form-privacy"]')).toBeVisible();
await expect(page.locator('[data-testid="form-submit"]')).toBeVisible();
});
test("should block submit when email is empty", async ({ page }) => {
await page.locator('[data-testid="form-name"]').fill("Test User");
await page.locator('[data-testid="form-message"]').fill("Test message");
await page.locator('[data-testid="form-privacy"]').check();
await page.locator('[data-testid="form-submit"]').click();
await expect(page.locator('[data-testid="error-email"]')).toBeVisible();
});
test("should block submit when privacy consent unchecked", async ({ page }) => {
await page.locator('[data-testid="form-name"]').fill("Test User");
await page.locator('[data-testid="form-email"]').fill("test@example.com");
await page.locator('[data-testid="form-message"]').fill("Test message");
await page.locator('[data-testid="form-submit"]').click();
await expect(page.locator('[data-testid="error-privacy"]')).toBeVisible();
});
test("should block submit when name is empty", async ({ page }) => {
await page.locator('[data-testid="form-email"]').fill("test@example.com");
await page.locator('[data-testid="form-message"]').fill("Test message");
await page.locator('[data-testid="form-privacy"]').check();
await page.locator('[data-testid="form-submit"]').click();
await expect(page.locator('[data-testid="error-name"]')).toBeVisible();
});
test("should be mobile-responsive at 375px width", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 667 });
await expect(page.locator('[data-testid="contact-form"]')).toBeVisible();
await expect(page.locator('[data-testid="office-card"]')).toBeVisible();
});
});