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

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.812 NEXT_PUBLIC_APP_VERSION=1.6.813
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.812 NEXT_PUBLIC_APP_VERSION=1.6.813
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.813] 2025-09-02
- WIP: Test fehlgeschlagen
---
## [1.6.812] 2025-09-02 ## [1.6.812] 2025-09-02
- test: extracted navigation tests to separate file - test: extracted navigation tests to separate file

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.812", "version": "1.6.813",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.812", "version": "1.6.813",
"dependencies": { "dependencies": {
"@fontsource/roboto": "^5.1.0", "@fontsource/roboto": "^5.1.0",
"@headlessui/react": "^2.2.4", "@headlessui/react": "^2.2.4",

View File

@@ -1,6 +1,6 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.812", "version": "1.6.813",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3000", "dev": "next dev -p 3000",

View File

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

View File

@@ -128,17 +128,18 @@ export async function runAnalogInputsTest(page: Page) {
.getByLabel("Messkurve anzeigen") .getByLabel("Messkurve anzeigen")
); );
await page.getByRole("cell", { name: "1", exact: true }).click(); // Einstellungen-Button in der ersten Datenzeile klicken und auf Modal warten
await expect(page.locator(".border.p-2.text-center").first()).toBeVisible(); const firstRow = page.getByRole("row", { name: /1\s+.*AE\s*1/i });
const settingsButtonInRow = firstRow.getByRole("button").first();
await page.locator(".border.p-2.text-center").first().click(); await settingsButtonInRow.waitFor({ state: "visible", timeout: 10000 });
await settingsButtonInRow.click();
await expect( await expect(
page.getByRole("heading", { name: "Einstellungen Messwerteingang" }) page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
).toBeVisible({ timeout: 15000 }); ).toBeVisible({ timeout: 15000 });
await highlightAndExpectVisible( await highlightAndExpectVisible(
page, page,
page.getByRole("heading", { name: "Einstellungen Messwerteingang" }) page.getByRole("heading", { name: /Einstellungen Messwerteingang/ })
); );
await highlightAndExpectVisible(page, page.getByText("Bezeichnung:")); await highlightAndExpectVisible(page, page.getByText("Bezeichnung:"));

View File

@@ -1,4 +1,5 @@
import type { Page } from "@playwright/test"; import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { highlightAndExpectVisible } from "@playwright/utils/highlight"; import { highlightAndExpectVisible } from "@playwright/utils/highlight";
import { navTest } from "@playwright/components/navTest"; import { navTest } from "@playwright/components/navTest";
import { headerTest } from "@playwright/components/headerTest"; 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: "3", exact: true }).click();
page.getByRole("cell", { name: "4", exact: true }).locator("svg").click(); page.getByRole("cell", { name: "4", exact: true }).locator("svg").click();
page.getByRole("cell", { name: "4", exact: true }).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();
} }