fix: logo und tests WIP

This commit is contained in:
ISA
2025-09-11 08:36:38 +02:00
parent 95c884bc07
commit 2ceebea533
31 changed files with 544 additions and 1198 deletions

View File

@@ -0,0 +1,131 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 1080,
width: 1920,
},
});
test("test", async ({ page }) => {
await page.goto("http://localhost:3000/analogInputs");
await expect(
page.getByRole("heading", { name: "Messwerteingänge" }).first()
).toBeVisible();
await expect(page.locator(".text-littwin-blue")).toBeVisible();
await expect(
page.getByRole("heading", { name: "Messwerteingänge" }).nth(1)
).toBeVisible();
await expect(page.getByRole("cell", { name: "Eingang" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Messwert" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Einheit" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Bezeichnung" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Einstellungen" })).toBeVisible();
await expect(
page.getByRole("cell", { name: "Messkurve", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "1", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "2", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "3", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "4", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "5", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "6", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "7", exact: true })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "8", exact: true })
).toBeVisible();
await expect(page.getByRole("cell", { name: "126.63" })).toBeVisible();
await expect(page.getByRole("cell", { name: "5.67" })).toBeVisible();
await expect(page.getByRole("cell", { name: "-" }).first()).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 1" })).toBeVisible();
await expect(page.getByRole("cell", { name: "Temperatur" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 3" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 4" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 5" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 6" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 7" })).toBeVisible();
await expect(page.getByRole("cell", { name: "AE 8" })).toBeVisible();
await expect(page.locator(".border.p-2.text-center").first()).toBeVisible();
await expect(page.locator("tr:nth-child(2) > td:nth-child(5)")).toBeVisible();
await expect(page.locator("tr:nth-child(8) > td:nth-child(5)")).toBeVisible();
await expect(page.locator("td:nth-child(6)").first()).toBeVisible();
await expect(page.locator("tr:nth-child(8) > td:nth-child(6)")).toBeVisible();
await page.locator(".border.p-2.text-center").first().click();
await expect(
page.getByRole("button", { name: "Modal schließen" })
).toBeVisible();
await page
.getByRole("heading", { name: "Einstellungen Messwerteingang" })
.click();
await page.getByText("Bezeichnung:").click();
await page.getByText("Offset:").click();
await page.getByText("Faktor:").click();
await page.getByText("Einheit:").click();
await page.getByText("Speicherintervall:").click();
await page.getByRole("textbox").click();
await page
.locator("div")
.filter({ hasText: /^Offset:$/ })
.getByRole("spinbutton")
.click();
await page
.locator("div")
.filter({ hasText: /^Faktor:$/ })
.getByRole("spinbutton")
.click();
await page.getByRole("button", { name: "V", exact: true }).click();
await page.getByRole("button", { name: "V", exact: true }).click();
await page
.locator("div")
.filter({ hasText: /^Minuten$/ })
.getByRole("spinbutton")
.click();
await expect(page.getByRole("button", { name: "Speichern" })).toBeVisible();
await page.getByRole("button", { name: "Modal schließen" }).click();
await page.locator("tr:nth-child(8) > td:nth-child(5)").click();
await expect(
page.getByRole("button", { name: "Modal schließen" })
).toBeVisible();
await page
.getByRole("heading", { name: "Einstellungen Messwerteingang" })
.click();
await page.getByText("Bezeichnung:").click();
await page.getByText("Offset:").click();
await page.getByText("Faktor:").click();
await page.getByText("Einheit:").click();
await page.getByText("Speicherintervall:").click();
await page.getByRole("textbox").click();
await page
.locator("div")
.filter({ hasText: /^Offset:$/ })
.getByRole("spinbutton")
.click();
await page
.locator("div")
.filter({ hasText: /^Faktor:$/ })
.getByRole("spinbutton")
.click();
await page.getByRole("button", { name: "mA" }).click();
await page.getByRole("button", { name: "mA" }).click();
await page
.locator("div")
.filter({ hasText: /^Minuten$/ })
.getByRole("spinbutton")
.click();
await expect(page.getByRole("button", { name: "Speichern" })).toBeVisible();
await page.getByRole("button", { name: "Modal schließen" }).click();
});

View File

@@ -1,254 +0,0 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
import { navTest } from "@/playwright/tests/components/navigation/navTest";
import { headerTest } from "@/playwright/tests/components/header/headerTest";
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
// Kombinierte Helper-Funktion: injiziert CSS (nur einmal), hebt hervor und prüft Sichtbarkeit
export async function runAnalogInputsTest(page: Page) {
await page.goto("/analogInputs");
//----------------------
await headerTest(page);
await navTest(page);
await footerTest(page);
await page.waitForTimeout(400);
//----------------------
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: "Messwerteingänge" }).nth(1)
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Eingang" })
);
// ...existing code...
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Messwert" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Einheit" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Bezeichnung" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Einstellungen" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Messkurve", exact: true })
);
await highlightAndExpectVisible(page, page.getByText("1", { exact: true }));
await highlightAndExpectVisible(page, page.getByText("2", { exact: true }));
await highlightAndExpectVisible(page, page.getByText("3", { exact: true }));
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "4", exact: true }).locator("path")
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "5", exact: true })
);
await highlightAndExpectVisible(page, page.getByText("6", { exact: true }));
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "7", exact: true })
);
await expect(
page.getByRole("cell", { name: "8", exact: true })
).toBeVisible();
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "8", exact: true })
);
await expect(page.locator(".border.p-2.text-center").first()).toBeVisible();
await highlightAndExpectVisible(
page,
page.locator(".border.p-2.text-center").first()
);
// Markiere die gesamte erste Datenzeile (Row mit "AE 1" falls vorhanden)
await highlightAndExpectVisible(
page,
page
.getByRole("row", { name: "2 5.67 °C Temperatur" })
.getByRole("button")
.first()
);
await expect(page.locator("tr:nth-child(3) > td:nth-child(5)")).toBeVisible();
await highlightAndExpectVisible(
page,
page.locator("tr:nth-child(3) > td:nth-child(5)")
);
await expect(
page
.getByRole("row", { name: "0.01 V AE 4 Messkurve anzeigen" })
.getByRole("button")
.first()
).toBeVisible();
await highlightAndExpectVisible(
page,
page
.getByRole("row", { name: "0.01 V AE 4 Messkurve anzeigen" })
.getByRole("button")
.first()
);
await expect(
page
.getByRole("row", { name: "8 -0.00 mA AE 8 Messkurve" })
.getByLabel("Messkurve anzeigen")
).toBeVisible();
await highlightAndExpectVisible(
page,
page
.getByRole("row", { name: "8 -0.00 mA AE 8 Messkurve" })
.getByLabel("Messkurve anzeigen")
);
// Einstellungen-Button in der ersten Datenzeile klicken und auf Modal warten
const firstRow = page.getByRole("row", { name: /1\s+.*AE\s*1/i });
const settingsButtonInRow = firstRow.getByRole("button").first();
await settingsButtonInRow.waitFor({ state: "visible", timeout: 10000 });
await settingsButtonInRow.click();
await expect(
page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
).toBeVisible({ timeout: 15000 });
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
);
await highlightAndExpectVisible(page, page.getByText("Bezeichnung:"));
await highlightAndExpectVisible(page, page.getByText("Offset:"), 5000);
await highlightAndExpectVisible(page, page.getByText("Faktor:"), 5000);
await highlightAndExpectVisible(page, page.getByText("Einheit:"), 5000);
await highlightAndExpectVisible(
page,
page.getByText("Speicherintervall:"),
5000
);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Speichern" })
);
await expect(
page.getByRole("button", { name: "Modal schließen" })
).toBeVisible();
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Modal schließen" })
);
await expect(
page.getByText(
"Einstellungen Messwerteingang 1Bezeichnung:Offset:Faktor:Einheit:"
)
).toBeVisible();
await highlightAndExpectVisible(
page,
page.getByText(
"Einstellungen Messwerteingang 1Bezeichnung:Offset:Faktor:Einheit:"
)
);
await page.getByRole("button", { name: "Modal schließen" }).click();
await expect(
page
.getByRole("row", { name: "1 126.63 V AE 1 Messkurve" })
.getByLabel("Messkurve anzeigen")
).toBeVisible();
await page
.getByRole("row", { name: "1 126.63 V AE 1 Messkurve" })
.getByLabel("Messkurve anzeigen")
.click();
await expect(
page.getByText(
"Messkurve Messwerteingang 1Eingang 1VonBisAlle MesswerteDaten laden"
)
).toBeVisible();
await highlightAndExpectVisible(
page,
page.getByText(
"Messkurve Messwerteingang 1Eingang 1VonBisAlle MesswerteDaten laden"
)
);
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: "Messkurve Messwerteingang" })
);
await highlightAndExpectVisible(page, page.locator("canvas"));
await highlightAndExpectVisible(page, page.getByText("Eingang 1VonBisAlle"));
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Daten laden" })
);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Alle Messwerte " })
);
await page.getByRole("button", { name: "Alle Messwerte " }).click();
await expect(page.getByRole("option", { name: "Stündlich" })).toBeVisible();
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 expect(page.getByRole("option", { name: "Täglich" })).toBeVisible();
await page.getByRole("option", { name: "Täglich" }).click();
await expect(page.getByRole("button", { name: "Fullscreen" })).toBeVisible();
await page.getByRole("button", { name: "Fullscreen" }).click();
await expect(
page.getByRole("button", { name: "Exit fullscreen" })
).toBeVisible();
await page.getByRole("button", { name: "Exit fullscreen" }).click();
await expect(page.getByRole("button", { name: "Fullscreen" })).toBeVisible();
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Fullscreen" })
);
// Modal schließen nur, wenn noch vorhanden
const modalCloseBtn = page.getByRole("button", { name: "Modal schließen" });
if ((await modalCloseBtn.count()) > 0 && (await modalCloseBtn.isVisible())) {
await highlightAndExpectVisible(page, modalCloseBtn);
await expect(modalCloseBtn).toBeVisible();
await modalCloseBtn.click();
}
}

View File

@@ -0,0 +1,62 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 900,
width: 1600,
},
});
test("Dashboard", async ({ page }) => {
await page.goto("http://localhost:3000/dashboard");
await expect(page.getByRole("main").locator("svg").first()).toBeVisible();
await expect(
page.getByRole("heading", { name: "Letzten 20 Meldungen" })
).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("heading", { name: "Versionsinformationen" })
).toBeVisible();
await expect(page.getByRole("main").locator("path").nth(2)).toBeVisible();
await expect(
page
.getByRole("listitem")
.filter({ hasText: "Webversion:" })
.locator("path")
).toBeVisible();
await expect(page.locator("div").filter({ hasText: /^1$/ })).toBeVisible();
await expect(page.getByText("8", { exact: true })).toBeVisible();
await expect(page.getByText("9", { exact: true })).toBeVisible();
await expect(
page.locator(
"div:nth-child(2) > .flex.gap-1 > div:nth-child(8) > .border > .bg-littwin-blue.flex-grow > div:nth-child(2)"
)
).toBeVisible();
await expect(page.getByText("17KÜ705FO")).toBeVisible();
await expect(
page.locator(
"div:nth-child(3) > .flex.gap-1 > div:nth-child(8) > .border > .bg-littwin-blue.flex-grow > div:nth-child(2)"
)
).toBeVisible();
await expect(page.getByText("25KÜ705FO")).toBeVisible();
await expect(page.getByText("32KÜ705FO")).toBeVisible();
await expect(page.getByRole("img", { name: "IP Address" })).toBeVisible();
await expect(page.getByText("IP-Adresse")).toBeVisible();
await expect(page.getByRole("main")).toContainText("10.10.0.243");
await expect(page.getByRole("main")).toContainText("255.255.255.0");
await expect(page.getByRole("main")).toContainText("10.10.0.1");
await page.getByText("Server betriebsbereit").click();
await page
.getByRole("row", { name: "2025-09-05 11:52:44" })
.getByRole("cell")
.first()
.click();
await expect(page.locator("tbody")).toContainText("2025-09-05 11:52:44");
await expect(page.locator("tbody")).toContainText("CableLine13");
await expect(page.locator("tbody")).toContainText("Isofehler gehend");
await expect(page.locator("tbody")).toContainText("0");
});

View File

@@ -1,90 +0,0 @@
import type { Page } from "@playwright/test";
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
import { navTest } from "@/playwright/tests/components/navigation/navTest";
import { headerTest } from "@/playwright/tests/components/header/headerTest";
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
export async function runDashboardTest(page: Page) {
await page.goto("/dashboard");
//----------------------
await headerTest(page);
await navTest(page);
await footerTest(page);
await page.waitForTimeout(400);
//----------------------
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: "Letzten 20 Meldungen" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Prio" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Zeitstempel" })
);
// ...existing code...
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Quelle" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Meldung" })
);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Status" })
);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^2KÜ705FO$/ })
.first()
);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^3KÜ705FO$/ })
.first()
);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^32KÜ705FO$/ })
.first()
);
await highlightAndExpectVisible(
page,
page.getByRole("img", { name: "IP Address" })
);
await highlightAndExpectVisible(page, page.getByText("IP-Adresse"));
await highlightAndExpectVisible(page, page.getByRole("main"));
await highlightAndExpectVisible(page, page.getByText("10.10.0.243"));
await highlightAndExpectVisible(page, page.getByText("Subnet-Maske"));
await highlightAndExpectVisible(
page,
page.getByRole("img", { name: "subnet mask" })
);
await highlightAndExpectVisible(page, page.getByText("255.255.255.0"));
await highlightAndExpectVisible(page, page.getByText("Gateway"));
await highlightAndExpectVisible(
page,
page.getByRole("img", { name: "gateway" })
);
await highlightAndExpectVisible(page, page.getByText("10.10.0.1"));
await highlightAndExpectVisible(page, page.getByText("OPC-UA"));
await highlightAndExpectVisible(
page,
page.getByRole("paragraph").filter({ hasText: "Status" })
);
await highlightAndExpectVisible(
page,
page.getByText("Server betriebsbereit")
);
}

View File

@@ -0,0 +1,225 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 1080,
width: 1920,
},
});
test("test", async ({ page }) => {
await page.goto("http://localhost:3000/digitalInputs");
//Snapshot
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- heading "Meldungseingänge" [level=1]
- heading /Meldungseingänge 1 \\d+/ [level=2]
- table:
- rowgroup:
- row "Eingang Zustand Bezeichnung Aktion":
- cell "Eingang"
- cell "Zustand"
- cell "Bezeichnung"
- cell "Aktion"
- rowgroup:
- row "1 ● DE 1":
- cell "1"
- cell "●"
- cell "DE 1"
- cell
- row "2 ● DE 2":
- cell "2"
- cell "●"
- cell "DE 2"
- cell
- row "3 ● DE 3":
- cell "3"
- cell "●"
- cell "DE 3"
- cell
- row "4 ● DE 4":
- cell "4"
- cell "●"
- cell "DE 4"
- cell
- row "5 ● DE 5":
- cell "5"
- cell "●"
- cell "DE 5"
- cell
- row "6 ● DE 6":
- cell "6"
- cell "●"
- cell "DE 6"
- cell
- row "7 ● DE 7":
- cell "7"
- cell "●"
- cell "DE 7"
- cell
- row "8 ● DE 8":
- cell "8"
- cell "●"
- cell "DE 8"
- cell
- row "9 ● DE 9":
- cell "9"
- cell "●"
- cell "DE 9"
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- heading /Meldungseingänge \\d+ \\d+/ [level=2]
- table:
- rowgroup:
- row "Eingang Zustand Bezeichnung Aktion":
- cell "Eingang"
- cell "Zustand"
- cell "Bezeichnung"
- cell "Aktion"
- rowgroup:
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
`);
//Snapshot
await page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.getByRole("cell")
.nth(3)
.click();
await page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.locator("svg")
.nth(1)
.click();
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- heading "Einstellungen Meldungseingang 1" [level=2]
- button "Modal schließen"
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "Bezeichnung:"
- textbox: DE 1
- text: "Invertierung:"
- switch [checked]
- text: "Ein Filterzeit:"
- spinbutton /Maximal \\d+ ms erlaubt/
- text: "ms Gewichtung:"
- spinbutton /Maximal \\d+ erlaubt/
- text: "Out of Service:"
- switch
- text: Aus
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(
`- button "Speichern"`
);
});

View File

@@ -0,0 +1,36 @@
import { test, expect } from "@playwright/test";
test.use({
viewport: {
height: 900,
width: 1600,
},
});
test("test", async ({ page }) => {
await page.goto("http://localhost:3000/kabelueberwachung");
await expect(page.getByRole("button", { name: "Rack 1" })).toBeVisible();
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();
});

View File

@@ -1,366 +0,0 @@
import type { Page } from "@playwright/test";
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
import { navTest } from "@/playwright/tests/components/navigation/navTest";
import { headerTest } from "@/playwright/tests/components/header/headerTest";
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
export async function runCableMonitoringTest(page: Page) {
await page.goto("/kabelueberwachung");
//----------------------
await headerTest(page);
await navTest(page);
await footerTest(page);
await page.waitForTimeout(400);
//----------------------
// Rack Buttons
for (const rack of [1, 2, 3, 4, 1]) {
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: `Rack ${rack}` })
);
await page.waitForTimeout(400);
}
// Kabel 1
await highlightAndExpectVisible(page, page.getByText("1", { exact: true }));
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator("div").filter({ hasText: /^8$/ })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("heading")
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("1", { exact: true }));
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^1KÜ705-FO⚙$/ })
.getByRole("button")
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".flex.flex-col > span").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".w-\\[0\\.625rem\\]").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator("span:nth-child(2)").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator(".w-\\[0\\.625rem\\].h-\\[0\\.625rem\\].rounded-full.bg-red-500")
.first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("Erdschluss").first());
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".text-center > span:nth-child(2)").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByText(/^RSL: \d+,\d{3} kOhm$/).first()
);
await page.waitForTimeout(400);
// Use a unique locator to avoid strict mode violation (two elements contain text "Kabel 1").
// The card exposes a title attribute "Kabel 1", so prefer getByTitle for a single match.
await highlightAndExpectVisible(page, page.getByTitle("Kabel 1").first());
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".text-black.text-\\[0\\.625rem\\].font-semibold").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".bg-littwin-blue.text-white.text-\\[0\\.625rem\\]").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".flex > button:nth-child(2)").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".bg-littwin-blue.text-white.cursor-pointer").first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("V4.20"));
await page.waitForTimeout(400);
// Kabel 8
await highlightAndExpectVisible(page, page.getByText("8", { exact: true }));
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^8KÜ705-FO⚙$/ })
.getByRole("heading")
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator("div")
.filter({ hasText: /^8KÜ705-FO⚙$/ })
.getByRole("button")
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page
.locator(
"div:nth-child(8) > .relative.bg-gray-300 > .relative.w-\\[7\\.075rem\\] > .flex.flex-col.mt-\\[0\\.625rem\\] > .flex.items-center.space-x-\\[0\\.25rem\\] > .flex.flex-col.items-start > span"
)
.first()
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(
"div:nth-child(8) > .relative.bg-gray-300 > .relative.w-\\[7\\.075rem\\] > .flex.flex-col.mt-\\[0\\.625rem\\] > .flex.items-center.space-x-\\[0\\.25rem\\] > .flex.flex-col.items-start > span:nth-child(2)"
)
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(
"div:nth-child(8) > .relative.bg-gray-300 > .relative.w-\\[7\\.075rem\\] > .flex.flex-col.mt-\\[0\\.625rem\\] > .flex.items-center.space-x-\\[0\\.25rem\\] > .flex.flex-col.items-center > .w-\\[0\\.625rem\\].h-\\[0\\.625rem\\].bg-green-500"
)
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(
"div:nth-child(8) > .relative.bg-gray-300 > .relative.w-\\[7\\.075rem\\] > .flex.flex-col.mt-\\[0\\.625rem\\] > .flex.items-center.space-x-\\[0\\.25rem\\] > .flex.flex-col.items-center > .w-\\[0\\.625rem\\].h-\\[0\\.625rem\\].rounded-full.bg-red-500"
)
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("Isolationsfehler"));
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(
"div:nth-child(8) > .relative.bg-gray-300 > .relative.w-\\[7\\.075rem\\] > .relative.mt-\\[3\\.125rem\\] > .text-center > span:nth-child(2)"
)
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByText(/^RSL: \d+,\d{3} kOhm$/).nth(3)
);
await page.waitForTimeout(400);
// For cable 8 the UI shows a long name and exposes it via title attribute; target it explicitly
await highlightAndExpectVisible(
page,
page.getByTitle("Kabel_8 in Salzgitter bei Hannover").first()
);
await page.waitForTimeout(400);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator(".bg-littwin-blue.text-white.text-\\[0\\.625rem\\]").first()
);
await page.waitForTimeout(400);
// ... (weitere Schritte können nach diesem Muster ergänzt werden)
// Beispiel für weitere Schritte aus dem Kommentar:
await highlightAndExpectVisible(
page,
page.locator(".bg-littwin-blue.text-white.text-\\[0\\.625rem\\]").first()
);
await page.waitForTimeout(400);
await page
.locator(".bg-littwin-blue.text-white.text-\\[0\\.625rem\\]")
.first()
.click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: "Isolationswiderstand" })
);
await page.waitForTimeout(400);
await page.getByRole("heading", { name: "Isolationswiderstand" }).click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("KÜ 1"));
await page.waitForTimeout(400);
await page.getByText("KÜ 1").click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("Von"));
await page.waitForTimeout(400);
await page.getByText("Von").click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator("div").filter({ hasText: /^Von$/ }).getByRole("textbox")
);
await page.waitForTimeout(400);
await page
.locator("div")
.filter({ hasText: /^Von$/ })
.getByRole("textbox")
.click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.getByText("Bis"));
await page.waitForTimeout(400);
await page.getByText("Bis").click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.locator("div").filter({ hasText: /^Bis$/ }).getByRole("textbox")
);
await page.waitForTimeout(400);
await page
.locator("div")
.filter({ hasText: /^Bis$/ })
.getByRole("textbox")
.click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Alle Messwerte" })
);
await page.waitForTimeout(400);
await page.getByRole("button", { name: "Alle Messwerte" }).click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("option", { name: "Stündliche Werte" })
);
await page.waitForTimeout(400);
await page.getByRole("option", { name: "Stündliche Werte" }).click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Stündliche Werte" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Daten laden" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(page, page.locator("canvas"));
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("button", { name: "Messkurve" })
);
await page.waitForTimeout(400);
await page.getByRole("button", { name: "Messkurve" }).click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("option", { name: "Meldungen" })
);
await page.waitForTimeout(400);
await page.getByRole("option", { name: "Meldungen" }).click();
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Prio" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Zeitstempel" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Quelle" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Meldung" })
);
await page.waitForTimeout(400);
await highlightAndExpectVisible(
page,
page.getByRole("cell", { name: "Status" })
);
await page.waitForTimeout(400);
}