test: playwright test erfolgreich

This commit is contained in:
ISA
2025-09-11 14:28:27 +02:00
parent bdaf0ec263
commit aedc7ccae5
15 changed files with 614 additions and 25 deletions

View File

@@ -0,0 +1,64 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 800,
width: 1280,
},
});
test("test", async ({ page }) => {
await page.goto("http://localhost:3000/kabelueberwachung");
await page
.locator(".bg-littwin-blue.text-white.cursor-pointer")
.first()
.click();
await expect(page.getByLabel("TDR Messung").getByRole("banner"))
.toMatchAriaSnapshot(`
- banner:
- heading "TDR-Messung" [level=3]
- button "Vollbild"
- button "Schließen"
- button "Messkurve "
`);
await expect(page.getByText("KÜ1")).toBeVisible();
await expect(
page.getByRole("button", { name: "TDR-Kurve als Referenz" })
).toBeVisible();
await expect(
page.getByRole("button", { name: "TDR-Messung starten" })
).toBeVisible();
await expect(
page.getByRole("button", { name: "27.03.2025, 23:42:41 " })
).toBeVisible();
await expect(page.locator("canvas")).toBeVisible();
await page.getByRole("button", { name: "Messkurve " }).click();
await page.getByRole("option", { name: "Meldungen" }).click();
await expect(page.getByText("Von")).toBeVisible();
await expect(
page.locator("div").filter({ hasText: /^Von$/ }).getByRole("textbox")
).toBeVisible();
await expect(page.getByText("Bis")).toBeVisible();
await expect(
page.locator("div").filter({ hasText: /^Bis$/ }).getByRole("textbox")
).toBeVisible();
await expect(page.getByRole("button", { name: "Anzeigen" })).toBeVisible();
await page.getByRole("cell", { name: "Prio" }).click();
await page.getByRole("cell", { name: "Zeitstempel" }).click();
await page.getByRole("cell", { name: "Quelle" }).click();
await page.getByRole("cell", { name: "Meldung" }).click();
await page.getByRole("cell", { name: "Status" }).click();
await page
.getByLabel("TDR Messung")
.locator("div")
.filter({
hasText:
"PrioZeitstempelQuelleMeldungStatus03.09.2025, 12:10:42CableLine1Modul",
})
.nth(3)
.click();
await page
.getByRole("dialog", { name: "TDR Messung" })
.getByLabel("Schließen")
.click();
});