From 74880d9ccc2002378668a5bdcdf5060f76bbade7 Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 11 Sep 2025 08:50:39 +0200 Subject: [PATCH] test: analogInputs.test.ts and dashboard.test.ts with import components --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 +++++ package-lock.json | 4 ++-- package.json | 2 +- playwright/tests/components/footer/footerTest.ts | 14 +++++++++----- .../tests/pages/analogInputs/analogInputs.test.ts | 8 ++++++++ playwright/tests/pages/dashboard/dashboard.test.ts | 8 ++++++++ 8 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.env.development b/.env.development index 5922a67..a9821ae 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.907 +NEXT_PUBLIC_APP_VERSION=1.6.908 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 fe24816..c565942 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.907 +NEXT_PUBLIC_APP_VERSION=1.6.908 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 16bb4f1..df738b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.908] – 2025-09-11 + +- chore: only *.test.ts for pages and components test + +--- ## [1.6.907] – 2025-09-11 - test: layout header, footer and sidebar diff --git a/package-lock.json b/package-lock.json index a74a2e1..a09f2ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.907", + "version": "1.6.908", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.907", + "version": "1.6.908", "dependencies": { "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", diff --git a/package.json b/package.json index 4e6bee7..084ceb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.907", + "version": "1.6.908", "private": true, "scripts": { "dev": "next dev -p 3000", diff --git a/playwright/tests/components/footer/footerTest.ts b/playwright/tests/components/footer/footerTest.ts index 53004a7..b77f382 100644 --- a/playwright/tests/components/footer/footerTest.ts +++ b/playwright/tests/components/footer/footerTest.ts @@ -4,11 +4,15 @@ import { Page, expect } from "@playwright/test"; * Footer assertions. */ export async function footerTest(page: Page) { - await expect(page.getByText(/Littwin Systemtechnik GmbH/)).toBeVisible(); - await expect(page.getByText(/Telefon: 04402 972577/)).toBeVisible(); + // Auf Footer-Bereich einschränken, damit Selektoren eindeutig bleiben + const footer = page.getByRole("contentinfo"); + await expect(footer).toBeVisible(); + + await expect(footer.getByText(/Littwin Systemtechnik GmbH/)).toBeVisible(); + await expect(footer.getByText(/Telefon: 04402 972577/)).toBeVisible(); await expect( - page.getByText(/kontakt@littwin-systemtechnik\.de/) + footer.getByText(/kontakt@littwin-systemtechnik\.de/) ).toBeVisible(); - // Handbücher Button/Icon (Text oder Button reicht) - await expect(page.getByText(/Handbücher/)).toBeVisible(); + // Exaktes Label im Footer, nicht die Überschrift "PDF Handbücher" + await expect(footer.getByText("Handbücher", { exact: true })).toBeVisible(); } diff --git a/playwright/tests/pages/analogInputs/analogInputs.test.ts b/playwright/tests/pages/analogInputs/analogInputs.test.ts index e019dcb..9495f00 100644 --- a/playwright/tests/pages/analogInputs/analogInputs.test.ts +++ b/playwright/tests/pages/analogInputs/analogInputs.test.ts @@ -1,4 +1,7 @@ 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: { @@ -9,6 +12,11 @@ test.use({ 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(); diff --git a/playwright/tests/pages/dashboard/dashboard.test.ts b/playwright/tests/pages/dashboard/dashboard.test.ts index 77d8380..be2d6e3 100644 --- a/playwright/tests/pages/dashboard/dashboard.test.ts +++ b/playwright/tests/pages/dashboard/dashboard.test.ts @@ -1,4 +1,7 @@ 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: { @@ -9,6 +12,11 @@ test.use({ test("Dashboard", async ({ page }) => { await page.goto("http://localhost:3000/dashboard"); + // Gemeinsame Layout-Checks + await headerTest(page); + await navTest(page); + await footerTest(page); + // Seitenspezifische Checks await expect(page.getByRole("main").locator("svg").first()).toBeVisible(); await expect( page.getByRole("heading", { name: "Letzten 20 Meldungen" })