fix: playwright Test bugs beheben

This commit is contained in:
ISA
2025-09-02 14:40:08 +02:00
parent 35e34b96d1
commit f4e0620b49
8 changed files with 21 additions and 32 deletions

View File

@@ -9,9 +9,9 @@ import { runSystemTest } from "./pages/system/systemTest";
import { runSettingsPageTest } from "./pages/settingsPage/settingsPageTest";
test("Dashboard, AnalogInputs und SettingsPage", async ({ page }) => {
// await runDashboardTest(page);
// await runCableMonitoringTest(page);
// await runDigitalInputsTest(page);
await runDashboardTest(page);
await runCableMonitoringTest(page);
await runDigitalInputsTest(page);
await runDigitalOutputsTest(page);
await runAnalogInputsTest(page);
await runMeldungenTest(page);

View File

@@ -128,17 +128,18 @@ export async function runAnalogInputsTest(page: Page) {
.getByLabel("Messkurve anzeigen")
);
await page.getByRole("cell", { name: "1", exact: true }).click();
await expect(page.locator(".border.p-2.text-center").first()).toBeVisible();
await page.locator(".border.p-2.text-center").first().click();
// 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" })
page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
).toBeVisible({ timeout: 15000 });
await highlightAndExpectVisible(
page,
page.getByRole("heading", { name: "Einstellungen Messwerteingang" })
page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
);
await highlightAndExpectVisible(page, page.getByText("Bezeichnung:"));

View File

@@ -1,4 +1,5 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
import { navTest } from "@playwright/components/navTest";
import { headerTest } from "@playwright/components/headerTest";
@@ -52,22 +53,4 @@ export async function runDigitalOutputsTest(page: Page) {
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();
}