import type { Page } from "@playwright/test"; import { highlightAndExpectVisible } from "@playwright/utils/highlight"; import { navTest } from "@playwright/components/navTest"; import { headerTest } from "@playwright/components/headerTest"; import { footerTest } from "@playwright/components/footerTest"; export async function runDigitalOutputsTest(page: Page) { await page.goto("/digitalOutputs"); //---------------------- await headerTest(page); await navTest(page); await footerTest(page); await page.waitForTimeout(400); //---------------------- await highlightAndExpectVisible(page, page.locator("h1")); page.locator("h1").click(); await highlightAndExpectVisible( page, page.locator("h2").filter({ hasText: "Schaltausgänge" }) ); page .locator("h2") .filter({ hasText: "Schaltausgänge" }) .locator("svg") .click(); page.locator("h2").filter({ hasText: "Schaltausgänge" }).click(); await highlightAndExpectVisible( page, page.getByRole("cell", { name: "Ausgang", exact: true }) ); const ausgang2Cell = page.getByRole("cell", { name: "Ausgang2" }).nth(1); await ausgang2Cell.waitFor({ state: "visible", timeout: 15000 }); // bis zu 15 Sekunden warten await ausgang2Cell.click(); await highlightAndExpectVisible( page, page.getByRole("cell", { name: "Schalter" }) ); await highlightAndExpectVisible( page, page.getByRole("cell", { name: "Schalter" }) ); await highlightAndExpectVisible( page, page.getByRole("cell", { name: "Aktion" }) ); page.getByRole("cell", { name: "1" }).locator("svg").click(); //page.getByRole("cell", { name: "1" }).click(); page.getByRole("cell", { name: "2", exact: true }).locator("svg").click(); page.getByRole("cell", { name: "2", exact: true }).click(); page.getByRole("cell", { name: "3", exact: true }).locator("svg").click(); page.getByRole("cell", { name: "3", exact: true }).click(); page.getByRole("cell", { name: "4", exact: true }).locator("svg").click(); page.getByRole("cell", { name: "4", exact: true }).click(); page.getByRole("cell", { name: "Ausgang2" }).first().click(); page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(1).click(); page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(1).click(); page.getByRole("row", { name: "2 Ausgang2" }).locator("path").nth(1).click(); page.getByRole("row", { name: "2 Ausgang2" }).locator("svg").nth(1).click(); page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(2).click(); page.getByRole("row", { name: "1 Ausgang2" }).locator("svg").nth(2).click(); page.getByRole("button", { name: "Modal schließen" }).click(); page.getByRole("row", { name: "2 Ausgang2" }).locator("svg").nth(2).click(); page.getByRole("button", { name: "Modal schließen" }).click(); page.getByRole("row", { name: "1 Ausgang2" }).locator("svg").nth(2).click(); page.getByRole("heading", { name: "Einstellungen Schaltausgang" }).click(); page.getByText("Bezeichnung:").click(); page.getByRole("textbox", { name: "z. B. Licht Relais" }).click(); page.getByRole("button", { name: "Modal schließen" }).click(); page.getByRole("row", { name: "2 Ausgang2" }).locator("path").nth(2).click(); }