import { test, expect } from "@playwright/test"; import { headerTest } from "@/playwright/tests/components/header/headerTest"; import { navTest } from "@/playwright/tests/components/navigation/navTest"; import { footerTest } from "@/playwright/tests/components/footer/footerTest"; test.use({ viewport: { height: 1080, width: 1920, }, }); test("test", async ({ page }) => { await page.goto("http://localhost:3000/analogInputs"); // Gemeinsame Layout-Checks await headerTest(page); await navTest(page); await footerTest(page); // Seitenspezifische Checks 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(); });