feat(T02): Static pages – home, referenzen, kontakt, legal (impressum/datenschutz/agb)
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("Home Page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/");
|
||||
});
|
||||
|
||||
test("should display hero with headline 'Veranstaltungstechnik'", async ({ page }) => {
|
||||
await expect(page.locator('[data-testid="hero-headline"]')).toContainText("Veranstaltungstechnik");
|
||||
});
|
||||
|
||||
test("should have CTA button linking to /mietkatalog", async ({ page }) => {
|
||||
const cta = page.locator('[data-testid="hero-cta-mietkatalog"]');
|
||||
await expect(cta).toBeVisible();
|
||||
await expect(cta).toHaveAttribute("to", "/mietkatalog");
|
||||
});
|
||||
|
||||
test("should have CTA button linking to /kontakt", async ({ page }) => {
|
||||
const cta = page.locator('[data-testid="hero-cta-kontakt"]');
|
||||
await expect(cta).toBeVisible();
|
||||
await expect(cta).toHaveAttribute("to", "/kontakt");
|
||||
});
|
||||
|
||||
test("should display all 8 services", async ({ page }) => {
|
||||
const servicesSection = page.locator('[data-testid="services-section"]');
|
||||
await expect(servicesSection).toBeVisible();
|
||||
await expect(servicesSection).toContainText("Vermietung");
|
||||
await expect(servicesSection).toContainText("Verkauf");
|
||||
await expect(servicesSection).toContainText("Personal");
|
||||
await expect(servicesSection).toContainText("Transport");
|
||||
await expect(servicesSection).toContainText("Lagerung");
|
||||
await expect(servicesSection).toContainText("Werkstatt");
|
||||
await expect(servicesSection).toContainText("Installation");
|
||||
await expect(servicesSection).toContainText("Booking");
|
||||
});
|
||||
|
||||
test("should display speaker grid with 6 equipment types", async ({ page }) => {
|
||||
const grid = page.locator('[data-testid="speaker-grid"]');
|
||||
await expect(grid).toBeVisible();
|
||||
await expect(grid).toContainText("Lautsprecher");
|
||||
await expect(grid).toContainText("Mischpulte");
|
||||
await expect(grid).toContainText("Lichtanlagen");
|
||||
await expect(grid).toContainText("Rigging");
|
||||
await expect(grid).toContainText("Traversen");
|
||||
await expect(grid).toContainText("Komplett-Setups");
|
||||
});
|
||||
|
||||
test("should display about section with stats", async ({ page }) => {
|
||||
const about = page.locator('[data-testid="about-section"]');
|
||||
await expect(about).toBeVisible();
|
||||
await expect(about).toContainText("20+");
|
||||
await expect(about).toContainText("1000+");
|
||||
await expect(about).toContainText("500+");
|
||||
});
|
||||
|
||||
test("should have mietkatalog CTA section", async ({ page }) => {
|
||||
const cta = page.locator('[data-testid="mietkatalog-cta"]');
|
||||
await expect(cta).toBeVisible();
|
||||
const link = page.locator('[data-testid="cta-mietkatalog-link"]');
|
||||
await expect(link).toBeVisible();
|
||||
});
|
||||
|
||||
test("should be mobile-responsive at 375px width", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await expect(page.locator('[data-testid="hero-headline"]')).toBeVisible();
|
||||
await expect(page.locator('[data-testid="services-section"]')).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,96 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("Impressum Page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/impressum");
|
||||
});
|
||||
|
||||
test("should display Impressum heading", async ({ page }) => {
|
||||
await expect(page.locator("h1")).toContainText("Impressum");
|
||||
});
|
||||
|
||||
test("should contain Hammerschmidt u. Mössle GbR", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Hammerschmidt u. Mössle GbR");
|
||||
});
|
||||
|
||||
test("should contain address Grockelhofen 10, 89340 Leipheim", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Grockelhofen 10");
|
||||
await expect(page.locator("body")).toContainText("89340 Leipheim");
|
||||
});
|
||||
|
||||
test("should contain phone number", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("204433");
|
||||
});
|
||||
|
||||
test("should contain email info@hms-licht-ton.de", async ({ page }) => {
|
||||
await expect(page.locator('a[href="mailto:info@hms-licht-ton.de"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test("should be mobile-responsive at 375px width", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await expect(page.locator("h1")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("Datenschutz Page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/datenschutz");
|
||||
});
|
||||
|
||||
test("should display Datenschutz heading", async ({ page }) => {
|
||||
await expect(page.locator("h1")).toContainText("Datenschutz");
|
||||
});
|
||||
|
||||
test("should contain DSGVO-relevant sections", async ({ page }) => {
|
||||
const body = page.locator("body");
|
||||
await expect(body).toContainText("Datenerhebung");
|
||||
await expect(body).toContainText("Cookies");
|
||||
await expect(body).toContainText("Kontaktformular");
|
||||
await expect(body).toContainText("Server-Log");
|
||||
await expect(body).toContainText("Drittanbieter");
|
||||
});
|
||||
|
||||
test("should mention responsible party", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Hammerschmidt u. Mössle GbR");
|
||||
});
|
||||
|
||||
test("should be mobile-responsive at 375px width", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await expect(page.locator("h1")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("AGB Vermietung Page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/agb-vermietung");
|
||||
});
|
||||
|
||||
test("should display AGB heading", async ({ page }) => {
|
||||
await expect(page.locator("h1")).toContainText("AGB");
|
||||
});
|
||||
|
||||
test("should contain Geltungsbereich section", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Geltungsbereich");
|
||||
});
|
||||
|
||||
test("should contain Preise section", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Preise");
|
||||
});
|
||||
|
||||
test("should contain Zahlungsbedingungen section", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Zahlungsbedingungen");
|
||||
});
|
||||
|
||||
test("should contain Haftung section", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Haftung");
|
||||
});
|
||||
|
||||
test("should contain Rückgabe section", async ({ page }) => {
|
||||
await expect(page.locator("body")).toContainText("Rückgabe");
|
||||
});
|
||||
|
||||
test("should be mobile-responsive at 375px width", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await expect(page.locator("h1")).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("Referenzen Page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/referenzen");
|
||||
});
|
||||
|
||||
test("should display page heading", async ({ page }) => {
|
||||
await expect(page).toHaveTitle(/Referenzen/);
|
||||
});
|
||||
|
||||
test("should show 9 gallery images in grid", async ({ page }) => {
|
||||
const grid = page.locator('[data-testid="gallery-grid"]');
|
||||
await expect(grid).toBeVisible();
|
||||
const items = grid.locator('[data-testid^="gallery-item-"]');
|
||||
await expect(items).toHaveCount(9);
|
||||
});
|
||||
|
||||
test("should have 4 category filter chips", async ({ page }) => {
|
||||
const chips = page.locator('[data-testid="filter-chips"]');
|
||||
await expect(chips).toBeVisible();
|
||||
await expect(chips).toContainText("Alle");
|
||||
await expect(chips).toContainText("Open-Air");
|
||||
await expect(chips).toContainText("Indoor");
|
||||
await expect(chips).toContainText("Rigging");
|
||||
});
|
||||
|
||||
test("should filter images by category", async ({ page }) => {
|
||||
// Click Open-Air filter
|
||||
await page.locator('[data-testid="filter-open-air"]').click();
|
||||
const grid = page.locator('[data-testid="gallery-grid"]');
|
||||
const items = grid.locator('[data-testid^="gallery-item-"]');
|
||||
const count = await items.count();
|
||||
expect(count).toBeLessThan(9);
|
||||
expect(count).toBeGreaterThan(0);
|
||||
|
||||
// Click Alle to reset
|
||||
await page.locator('[data-testid="filter-alle"]').click();
|
||||
await expect(items).toHaveCount(9);
|
||||
});
|
||||
|
||||
test("should open lightbox on image click", async ({ page }) => {
|
||||
const firstItem = page.locator('[data-testid="gallery-item-1"]');
|
||||
await firstItem.click();
|
||||
const lightbox = page.locator('[data-testid="lightbox"]');
|
||||
await expect(lightbox).toBeVisible();
|
||||
});
|
||||
|
||||
test("should close lightbox with close button", async ({ page }) => {
|
||||
await page.locator('[data-testid="gallery-item-1"]').click();
|
||||
const lightbox = page.locator('[data-testid="lightbox"]');
|
||||
await expect(lightbox).toBeVisible();
|
||||
await page.locator('[data-testid="lightbox-close"]').click();
|
||||
await expect(lightbox).not.toBeVisible();
|
||||
});
|
||||
|
||||
test("should navigate to next image in lightbox", async ({ page }) => {
|
||||
await page.locator('[data-testid="gallery-item-1"]').click();
|
||||
const lightbox = page.locator('[data-testid="lightbox"]');
|
||||
await expect(lightbox).toBeVisible();
|
||||
const firstCaption = await lightbox.locator("p").textContent();
|
||||
await page.locator('[data-testid="lightbox-next"]').click();
|
||||
const secondCaption = await lightbox.locator("p").textContent();
|
||||
expect(firstCaption).not.toBe(secondCaption);
|
||||
});
|
||||
|
||||
test("should navigate to prev image in lightbox", async ({ page }) => {
|
||||
await page.locator('[data-testid="gallery-item-1"]').click();
|
||||
const lightbox = page.locator('[data-testid="lightbox"]');
|
||||
await expect(lightbox).toBeVisible();
|
||||
await page.locator('[data-testid="lightbox-prev"]').click();
|
||||
await expect(lightbox).toBeVisible();
|
||||
});
|
||||
|
||||
test("should be mobile-responsive at 375px width", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await expect(page.locator('[data-testid="gallery-grid"]')).toBeVisible();
|
||||
await expect(page.locator('[data-testid="filter-chips"]')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user