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

@@ -20,24 +20,85 @@ test("Kabelüberwachung", async ({ page }) => {
await expect(page.getByRole("button", { name: "Rack 2" })).toBeVisible();
await expect(page.getByRole("button", { name: "Rack 3" })).toBeVisible();
await expect(page.getByRole("button", { name: "Rack 4" })).toBeVisible();
await expect(
page.getByText(
"1KÜ705-FO⚙BetriebAlarmErdschluss ISO: 10,00 MOhmRSL: 0,000 kOhmKabel 1Kabel 1V4"
)
).toBeVisible();
await expect(
page.getByText("DetailansichtISORSLTDRKVZ").first()
).toBeVisible();
await expect(
page.locator(".bg-littwin-blue.text-white").first()
).toBeVisible();
await expect(
page.locator(".flex > button:nth-child(2)").first()
).toBeVisible();
await expect(
page.locator(".bg-littwin-blue.text-white.cursor-pointer").first()
).toBeVisible();
await expect(
page.getByRole("button", { name: "KVZ", exact: true }).first()
).toBeVisible();
//--
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "1"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Erdschluss ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 1 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ"
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "2"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Messpannung ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 2 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button
- button "KVZ"
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "3"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Erdschluss ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 3 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ"
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "4"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Aderbruch ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 4 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ nicht verfügbar" [disabled]
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "5"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 5 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ nicht verfügbar" [disabled]
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "6"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 6 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ nicht verfügbar" [disabled]
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "7"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Schleifenfehler ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel 7 V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ nicht verfügbar" [disabled]
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "8"
- heading /KÜ\\d+-FO/ [level=3]
- button "⚙"
- text: "/Betrieb Alarm Isolationsfehler ISO: \\\\d+,\\\\d+ MOhm RSL: \\\\d+,\\\\d+ kOhm Kabel_8 in Salzgitter bei Hannover Kabel_8 in Salzgitter bei Hannover V4\\\\.\\\\d+ Detailansicht/"
- button "ISO"
- button "RSL"
- button "TDR"
- button "KVZ nicht verfügbar" [disabled]
`);
});

View File

@@ -0,0 +1,108 @@
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();
});

View File

@@ -0,0 +1,81 @@
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.getByRole("button", { name: "KVZ", exact: true }).first().click();
await expect(
page
.getByRole("dialog", { name: "KVZ Zustände & Meldungen" })
.getByRole("banner")
).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 expect(page.getByText("Bis")).toBeVisible();
await page
.getByRole("dialog", { name: "KVZ Zustände & Meldungen" })
.getByRole("banner")
.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("dialog", { name: "KVZ Zustände & Meldungen" })
.getByRole("banner")
.click();
await expect(page.getByRole("button", { name: "Anzeigen" })).toBeVisible();
await expect(page.getByText("KVZ1")).toBeVisible();
await expect(page.getByTitle("Slot 0 LED1: Ein")).toBeVisible();
await expect(page.getByText("KVZ2", { exact: true })).toBeVisible();
await expect(page.getByTitle("Slot 0 LED2: Aus")).toBeVisible();
await expect(page.getByText("KVZ3", { exact: true })).toBeVisible();
await expect(page.getByTitle("Slot 0 LED3: Unbekannt")).toBeVisible();
await expect(page.getByText("KVZ4", { exact: true })).toBeVisible();
await expect(page.getByTitle("Slot 0 LED4: Ein")).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 page.getByRole("button", { name: "Vollbild" }).click();
await page
.getByRole("dialog", { name: "KVZ Zustände & Meldungen" })
.getByLabel("Schließen")
.click();
});

View File

@@ -0,0 +1,90 @@
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(".flex > button:nth-child(2)").first().click();
await expect(page.getByLabel("Schleifenwiderstand").getByRole("banner"))
.toMatchAriaSnapshot(`
- banner:
- heading "Schleifenwiderstand" [level=3]
- button "Vollbild"
- button "Schließen"
- button "Messkurve "
`);
await expect(page.getByLabel("Schleifenwiderstand")).toMatchAriaSnapshot(`
- text: KÜ 1 Von
- textbox: /\\d+\\.\\d+\\.\\d+/
- text: Bis
- textbox: /\\d+\\.\\d+\\.\\d+/
- button "Alle Messwerte "
- button "RSL Messung starten"
- button "Daten laden"
`);
await page.getByRole("button", { name: "Alle Messwerte " }).click();
await page.getByRole("option", { name: "Stündlich" }).click();
await expect(page.getByLabel("Schleifenwiderstand")).toMatchAriaSnapshot(`
- text: KÜ 1 Von
- textbox: /\\d+\\.\\d+\\.\\d+/
- text: Bis
- textbox: /\\d+\\.\\d+\\.\\d+/
- button "Stündlich "
- button "RSL Messung starten"
- button "Daten laden"
`);
await page.getByRole("button", { name: "Stündlich " }).click();
await page.getByRole("option", { name: "Täglich" }).click();
await expect(page.getByLabel("Schleifenwiderstand")).toMatchAriaSnapshot(`
- text: KÜ 1 Von
- textbox: /\\d+\\.\\d+\\.\\d+/
- text: Bis
- textbox: /\\d+\\.\\d+\\.\\d+/
- button "Täglich "
- button "RSL Messung starten"
- button "Daten laden"
`);
await page.locator("canvas").click({
position: {
x: 128,
y: 41,
},
});
await expect(page.locator("canvas")).toBeVisible();
await page.getByRole("button", { name: "Messkurve " }).click();
await page.getByRole("option", { name: "Meldungen" }).click();
await expect(page.getByText("SchleifenwiderstandMeldungen")).toBeVisible();
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 expect(
page
.getByLabel("Schleifenwiderstand")
.locator("div")
.filter({
hasText:
"PrioZeitstempelQuelleMeldungStatus03.09.2025, 12:10:42CableLine1Modul",
})
.nth(4)
).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
.getByRole("dialog", { name: "Schleifenwiderstand" })
.getByLabel("Schließen")
.click();
});

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();
});

View File

@@ -0,0 +1,91 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 800,
width: 1280,
},
});
test("test", async ({ page }) => {
await page.goto("kabelueberwachung");
await page
.locator("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("button")
.click();
await expect(
page.locator("div").filter({ hasText: /^Einstellungen KÜ 1$/ })
).toBeVisible();
await expect(page.getByText("AllgemeinTDRKVzKnotenpunkte")).toBeVisible();
await expect(page.getByText("Kabelbezeichnung:")).toBeVisible();
await expect(
page.getByRole("textbox", { name: "Feld kann nicht bearbeitet" })
).toBeVisible();
await expect(page.getByText("Kabelname:")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Kabelname:$/ })
.getByRole("textbox")
).toBeVisible();
await expect(page.getByText("Speicherintervall:")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Minuten$/ })
.getByRole("spinbutton")
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Isolationsmessung" })
).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Grenzwert:MOhm$/ })
.locator("label")
).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^MOhm$/ })
.getByRole("spinbutton")
).toBeVisible();
await expect(page.getByText("Verzögerung:")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Sekunden$/ })
.getByRole("spinbutton")
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Schleifenmessung" })
).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Grenzwert:kOhm$/ })
.locator("label")
).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^kOhm$/ })
.getByRole("spinbutton")
).toBeVisible();
await expect(page.getByText("Schleifenmessintervall:")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Stunden$/ })
.getByRole("spinbutton")
).toBeVisible();
await expect(
page.getByRole("button", { name: "Display einschalten" })
).toBeVisible();
await expect(page.getByRole("button", { name: "Speichern" })).toBeVisible();
await expect(
page.getByRole("button", { name: "Modal schließen" })
).toBeVisible();
await page.getByRole("button", { name: "Modal schließen" }).click();
});

View File

@@ -0,0 +1,26 @@
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("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("button")
.click();
await page.getByRole("button", { name: "KVz", exact: true }).click();
await page
.locator("div")
.filter({
hasText: /^Nur Admin-Benutzer können diese Einstellungen ändern\.$/,
})
.nth(1)
.click();
await page.getByRole("button", { name: "Modal schließen" }).click();
});

View File

@@ -0,0 +1,35 @@
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("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("button")
.click();
await page.getByRole("button", { name: "Knotenpunkte" }).click();
await page.getByText("Knoten 1:").click();
await page
.locator("div")
.filter({ hasText: /^Knoten 1:↳ Verbindung:m$/ })
.locator("span")
.first()
.click();
await page.getByText("Knoten 2:").click();
await page
.locator("div")
.filter({ hasText: /^Knoten 2:↳ Verbindung:m$/ })
.locator("span")
.first()
.click();
await page.getByText("Knoten 3:").click();
await page.getByText("Knoten 10:").click();
await page.getByRole("button", { name: "Modal schließen" }).click();
});

View File

@@ -0,0 +1,24 @@
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("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("button")
.click();
await page
.getByLabel("Einstellungen KÜ")
.getByRole("button", { name: "TDR" })
.click();
await expect(
page.getByText("TDR Dämpfung:dBGeschwindigkeit:m/µsTrigger:Speichern")
).toBeVisible();
});