From fb7981713671d3294bf70b379c1a4fb97cf5f197 Mon Sep 17 00:00:00 2001 From: ISA Date: Tue, 2 Sep 2025 11:48:54 +0200 Subject: [PATCH] test: extracted navigation tests to separate file --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 + package-lock.json | 4 +- package.json | 2 +- playwright/components/footerTest.ts | 55 ++++++++++ playwright/components/headerTest.ts | 18 ++++ .../tests/pages/dashboard/dashboardTest.ts | 101 ++---------------- 8 files changed, 91 insertions(+), 98 deletions(-) diff --git a/.env.development b/.env.development index 19e955f..c3d6677 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.810 +NEXT_PUBLIC_APP_VERSION=1.6.811 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 348fe34..dd9a98b 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.810 +NEXT_PUBLIC_APP_VERSION=1.6.811 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 439bcba..ec2849f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.811] – 2025-09-02 + +- Test: nav ausgelagert + +--- ## [1.6.810] – 2025-09-02 - Test: done diff --git a/package-lock.json b/package-lock.json index 12f1e9a..7b0ffcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.810", + "version": "1.6.811", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.810", + "version": "1.6.811", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index 4de7328..3cfad5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.810", + "version": "1.6.811", "private": true, "scripts": { "dev": "next dev -p 3000", diff --git a/playwright/components/footerTest.ts b/playwright/components/footerTest.ts index e69de29..2c1d276 100644 --- a/playwright/components/footerTest.ts +++ b/playwright/components/footerTest.ts @@ -0,0 +1,55 @@ +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; + +export async function footerTest(page: Page) { + await highlightAndExpectVisible( + page, + page + .locator("div") + .filter({ hasText: /^Littwin Systemtechnik GmbH & Co\. KG$/ }) + .locator("svg") + ); + await highlightAndExpectVisible( + page, + page.getByText("Littwin Systemtechnik GmbH &") + ); + await highlightAndExpectVisible( + page, + page + .locator("div") + .filter({ hasText: /^Telefon: 04402 972577-0$/ }) + .locator("svg") + ); + await highlightAndExpectVisible( + page, + page.getByText("Telefon: 04402 972577-") + ); + await highlightAndExpectVisible( + page, + page + .locator("div") + .filter({ hasText: /^kontakt@littwin-systemtechnik\.de$/ }) + .locator("svg") + ); + await highlightAndExpectVisible( + page, + page.getByText("kontakt@littwin-systemtechnik") + ); + await highlightAndExpectVisible( + page, + page + .locator("div") + .filter({ hasText: /^Handbücher$/ }) + .locator("svg") + ); + await highlightAndExpectVisible( + page, + page.getByText("Handbücher", { exact: true }) + ); + await page.getByText("Handbücher", { exact: true }).click(); + await highlightAndExpectVisible( + page, + page.getByRole("heading", { name: "PDF Handbücher" }) + ); + await highlightAndExpectVisible(page, page.getByText("KUE705FO.PDF")); +} diff --git a/playwright/components/headerTest.ts b/playwright/components/headerTest.ts index e69de29..9283765 100644 --- a/playwright/components/headerTest.ts +++ b/playwright/components/headerTest.ts @@ -0,0 +1,18 @@ +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; + +export async function headerTest(page: Page) { + await highlightAndExpectVisible( + page, + page.getByRole("heading", { name: "Meldestation" }) + ); + await highlightAndExpectVisible(page, page.getByRole("banner")); + await highlightAndExpectVisible( + page, + page.getByRole("img", { name: "Logo", exact: true }) + ); + await highlightAndExpectVisible( + page, + page.getByRole("main").locator("svg").first() + ); +} diff --git a/playwright/tests/pages/dashboard/dashboardTest.ts b/playwright/tests/pages/dashboard/dashboardTest.ts index 89f1e04..8517b81 100644 --- a/playwright/tests/pages/dashboard/dashboardTest.ts +++ b/playwright/tests/pages/dashboard/dashboardTest.ts @@ -1,21 +1,15 @@ 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 runDashboardTest(page: Page) { await page.goto("http://localhost:3000/dashboard"); - await highlightAndExpectVisible( - page, - page.getByRole("heading", { name: "Meldestation" }) - ); - await highlightAndExpectVisible(page, page.getByRole("banner")); - await highlightAndExpectVisible( - page, - page.getByRole("img", { name: "Logo", exact: true }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("main").locator("svg").first() - ); + + await headerTest(page); + // Navigation-Tests ausgelagert: + await navTest(page); + await footerTest(page); await highlightAndExpectVisible( page, page.getByRole("heading", { name: "Letzten 20 Meldungen" }) @@ -41,32 +35,7 @@ export async function runDashboardTest(page: Page) { page, page.getByRole("cell", { name: "Status" }) ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Übersicht" }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Kabelüberwachung" }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Meldungseingänge" }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Schaltausgänge" }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Messwerteingänge" }) - ); - await highlightAndExpectVisible( - page, - page.getByRole("link", { name: "Berichte" }) - ); - // Navigation-Tests ausgelagert: - await navTest(page); + await highlightAndExpectVisible( page, page @@ -116,58 +85,4 @@ export async function runDashboardTest(page: Page) { page, page.getByText("Server betriebsbereit") ); - await highlightAndExpectVisible( - page, - page - .locator("div") - .filter({ hasText: /^Littwin Systemtechnik GmbH & Co\. KG$/ }) - .locator("svg") - ); - await highlightAndExpectVisible( - page, - page.getByText("Littwin Systemtechnik GmbH &") - ); - await highlightAndExpectVisible( - page, - page - .locator("div") - .filter({ hasText: /^Telefon: 04402 972577-0$/ }) - .locator("svg") - ); - await highlightAndExpectVisible( - page, - page.getByText("Telefon: 04402 972577-") - ); - await highlightAndExpectVisible( - page, - page - .locator("div") - .filter({ hasText: /^kontakt@littwin-systemtechnik\.de$/ }) - .locator("svg") - ); - await highlightAndExpectVisible( - page, - page.getByText("kontakt@littwin-systemtechnik") - ); - await highlightAndExpectVisible( - page, - page - .locator("div") - .filter({ hasText: /^Handbücher$/ }) - .locator("svg") - ); - await highlightAndExpectVisible( - page, - page.getByText("Handbücher", { exact: true }) - ); - await page.getByText("Handbücher", { exact: true }).click(); - await highlightAndExpectVisible( - page, - page.getByRole("heading", { name: "PDF Handbücher" }) - ); - await highlightAndExpectVisible(page, page.getByText("KUE705FO.PDF")); - //await highlightAndExpectVisible(page, page.getByRole("button")); - //await page.getByRole("button").click(); } - -//---------------------------------------------------------------------