Files
CPLv4.0/playwright/tests/pages/kabelueberwachung/modals/isoModal.test.ts
2025-09-11 14:28:27 +02:00

109 lines
4.3 KiB
TypeScript

import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 800,
width: 1280,
},
});
test("test", async ({ page }) => {
await page.goto("/kabelueberwachung");
await page.locator(".bg-littwin-blue.text-white").first().click();
await expect(page.getByText("IsolationswiderstandMesskurve")).toBeVisible();
await expect(page.getByRole("button", { name: "Messkurve " })).toBeVisible();
await expect(page.getByText("KÜ1")).toBeVisible();
await expect(page.getByText("Von")).toBeVisible();
await expect(
page.locator("div").filter({ hasText: /^Von$/ }).getByRole("textbox")
).toBeVisible();
await page
.locator("div")
.filter({ hasText: /^Von$/ })
.getByRole("textbox")
.click();
await expect(page.getByLabel("Sunday", { exact: true })).toBeVisible();
await expect(page.getByLabel("Saturday", { exact: true })).toBeVisible();
await page.getByRole("textbox").first().click();
await page.getByRole("textbox").first().click();
await page.getByText("IsolationswiderstandMesskurve").click();
await expect(page.getByText("Bis")).toBeVisible();
await expect(
page.locator("div").filter({ hasText: /^Bis$/ }).getByRole("textbox")
).toBeVisible();
await page
.locator("div")
.filter({ hasText: /^Bis$/ })
.getByRole("textbox")
.click();
await expect(page.getByLabel("Sunday", { exact: true })).toBeVisible();
await expect(page.getByLabel("Saturday", { exact: true })).toBeVisible();
await page.getByRole("textbox").nth(1).click();
await page.getByText("IsolationswiderstandMesskurve").click();
await expect(
page.getByRole("button", { name: "Alle Messwerte " })
).toBeVisible();
await page.getByRole("button", { name: "Alle Messwerte " }).click();
// await expect(page.getByRole("button", { name: "Daten laden" })).toBeVisible();
await page.getByRole("button", { name: "Alle Messwerte " }).click();
await expect(page.locator("canvas")).toBeVisible();
await page.getByRole("button", { name: "Alle Messwerte " }).click();
await page.getByRole("option", { name: "Stündlich" }).click();
await expect(page.getByRole("button", { name: "Stündlich " })).toBeVisible();
await page.getByRole("button", { name: "Stündlich " }).click();
await page.getByRole("option", { name: "Täglich" }).click();
await expect(page.getByRole("button", { name: "Täglich " })).toBeVisible();
await page.getByRole("button", { name: "Messkurve " }).click();
await page.getByRole("option", { name: "Meldungen" }).click();
await expect(page.getByRole("button", { name: "Meldungen " })).toBeVisible();
await expect(page.getByText("VonBisAnzeigen")).toBeVisible();
await page
.locator("div")
.filter({ hasText: /^Von$/ })
.getByRole("textbox")
.click();
await expect(page.getByRole("textbox").first()).toBeVisible();
await page
.locator("div")
.filter({ hasText: /^Bis$/ })
.getByRole("textbox")
.click();
await page.getByText("IsolationswiderstandMeldungen").click();
await expect(page.getByRole("button", { name: "Anzeigen" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Prio" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Zeitstempel" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Quelle" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Meldung" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Status" })).toBeVisible();
await expect(
page
.getByRole("row", { name: "12:10:42 CableLine1 Modul online online" })
.getByRole("cell")
.first()
).toBeVisible();
await expect(
page
.getByRole("row", { name: "12:10:42 CableLine1 Aderbruch kommend 1" })
.getByRole("cell")
.first()
).toBeVisible();
await expect(
page
.getByRole("row", { name: "12:10:42 CableLine1 Aderbruch gehend 0" })
.getByRole("cell")
.first()
).toBeVisible();
await expect(
page
.getByRole("row", { name: "12:10:42 CableLine1 Isofehler gehend 0" })
.getByRole("cell")
.first()
).toBeVisible();
await page.getByRole("button", { name: "Vollbild" }).click();
await page.getByRole("button", { name: "Vollbild verlassen" }).click();
await page
.getByRole("dialog", { name: "Isolationswiderstand" })
.getByLabel("Schließen")
.click();
});