import { test, expect } from "@playwright/test"; test("shop overview lists products", async ({ page }) => { await page.goto("/shop"); await expect(page.getByRole("heading", { name: "Unser Sortiment" })).toBeVisible(); await expect(page.getByRole("link", { name: /Zum Honig|Zum Produkt/i }).first()).toBeVisible(); }); test("adding a product to the cart updates the cart count", async ({ page }) => { await page.goto("/honig/fruehtracht-2026"); // "In den Warenkorb" erscheint mehrfach auf der Seite (Haupt-CTA oben, // weitere in der "Das koennte dir auch gefallen"-Produktkarten-Sektion // weiter unten) — .first() greift gezielt den Haupt-CTA des Produkts. const cartButton = page.getByRole("button", { name: /Warenkorb öffnen/ }); const initialLabel = await cartButton.getAttribute("aria-label"); await page.getByRole("button", { name: "In den Warenkorb" }).first().click(); await expect(cartButton).not.toHaveAttribute("aria-label", initialLabel ?? ""); });