WIP: Playwright test

This commit is contained in:
ISA
2025-08-15 14:47:29 +02:00
parent 04b9a0dc1d
commit a84e8c529f
6 changed files with 127 additions and 5 deletions

View File

@@ -0,0 +1,117 @@
import { test, expect } from "@playwright/test";
test("test", async ({ page }) => {
await page.goto("http://localhost:3000/digitalInputs");
await expect(
page.getByRole("img", { name: "Logo", exact: true })
).toBeVisible();
await expect(page.getByRole("img", { name: "TALAS Logo" })).toBeVisible();
await expect(
page.getByRole("heading", { name: "Meldestation" })
).toBeVisible();
await expect(page.getByText("CPLV4 Ismail Rastede")).toBeVisible();
await expect(page.getByRole("link", { name: "Übersicht" })).toBeVisible();
await expect(
page.getByRole("link", { name: "Kabelüberwachung" })
).toBeVisible();
await expect(
page.getByRole("link", { name: "Meldungseingänge" })
).toBeVisible();
await expect(
page.getByRole("link", { name: "Schaltausgänge" })
).toBeVisible();
await expect(
page.getByRole("link", { name: "Messwerteingänge" })
).toBeVisible();
await expect(page.getByRole("link", { name: "Berichte" })).toBeVisible();
await expect(page.getByRole("link", { name: "System" })).toBeVisible();
await expect(page.getByRole("link", { name: "Einstellungen" })).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Littwin Systemtechnik GmbH & Co\. KG$/ })
.locator("svg")
).toBeVisible();
await expect(page.getByText("Littwin Systemtechnik GmbH &")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Telefon: 04402 972577-0$/ })
.locator("svg")
).toBeVisible();
await expect(page.getByText("Telefon: 04402 972577-")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^kontakt@littwin-systemtechnik\.de$/ })
.locator("svg")
).toBeVisible();
await expect(page.getByText("kontakt@littwin-systemtechnik")).toBeVisible();
await expect(
page
.locator("div")
.filter({ hasText: /^Handbücher$/ })
.locator("path")
).toBeVisible();
await expect(page.getByText("Handbücher", { exact: true })).toBeVisible();
await page.getByText("Handbücher", { exact: true }).click();
await expect(
page.getByRole("heading", { name: "PDF Handbücher" })
).toBeVisible();
await expect(page.getByText("KUE705FO.PDF")).toBeVisible();
await page.getByRole("button").click();
await expect(
page.getByRole("heading", { name: "Meldungseingänge", exact: true })
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Meldungseingänge 1 " }).locator("svg")
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Meldungseingänge 1 " })
).toBeVisible();
await expect(
page.getByRole("cell", { name: "Eingang" }).first()
).toBeVisible();
await expect(
page.getByRole("cell", { name: "Zustand" }).first()
).toBeVisible();
await expect(
page.getByRole("cell", { name: "Bezeichnung" }).first()
).toBeVisible();
await expect(
page.getByRole("cell", { name: "Aktion" }).first()
).toBeVisible();
await expect(
page.getByRole("cell", { name: "1", exact: true }).locator("svg")
).toBeVisible();
await expect(page.getByText("1", { exact: true })).toBeVisible();
await expect(
page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.getByRole("cell")
.nth(1)
).toBeVisible();
await expect(
page.getByRole("row", { name: "1 ● DE 1", exact: true }).locator("span")
).toBeVisible();
await expect(
page.getByRole("cell", { name: "DE 1", exact: true })
).toBeVisible();
await expect(
page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.locator("svg")
.nth(1)
).toBeVisible();
await expect(
page.getByRole("cell", { name: "13", exact: true }).locator("svg")
).toBeVisible();
await expect(page.getByText("13", { exact: true })).toBeVisible();
await expect(
page.getByRole("row", { name: "● DE 13" }).getByRole("cell").nth(1)
).toBeVisible();
await expect(
page.getByRole("row", { name: "● DE 13" }).locator("span")
).toBeVisible();
await expect(page.getByRole("cell", { name: "DE 13" })).toBeVisible();
});