From c8616f7bbee20b85213beaaf76c45a2a9346633b Mon Sep 17 00:00:00 2001 From: ISA Date: Tue, 2 Sep 2025 11:08:34 +0200 Subject: [PATCH] Test: done --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 +++ package-lock.json | 4 +- package.json | 2 +- .../components/{footer.ts => footerTest.ts} | 0 .../components/{header.ts => headerTest.ts} | 0 playwright/components/nav.ts | 0 playwright/components/navTest.ts | 38 ++++++++++++++++ .../tests/pages/dashboard/dashboardTest.ts | 41 +----------------- .../digitalOutputs/digitalOutputsTest.ts | 40 +---------------- .../kabelueberwachungTest.ts | 41 +----------------- .../tests/pages/meldungen/meldungenTest.ts | 2 +- .../pages/settingsPage/settingsPageTest.ts | 43 +------------------ playwright/tests/pages/system/systemTest.ts | 40 +---------------- 15 files changed, 59 insertions(+), 201 deletions(-) rename playwright/components/{footer.ts => footerTest.ts} (100%) rename playwright/components/{header.ts => headerTest.ts} (100%) delete mode 100644 playwright/components/nav.ts create mode 100644 playwright/components/navTest.ts diff --git a/.env.development b/.env.development index 7f18a68..b33cd61 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.808 +NEXT_PUBLIC_APP_VERSION=1.6.809 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 b815dc0..646452f 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.808 +NEXT_PUBLIC_APP_VERSION=1.6.809 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ab58de1..dde5abd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.809] – 2025-09-02 + +- chore: remove jsconfig.json, project uses only tsconfig.json for path aliases + +--- ## [1.6.808] – 2025-09-02 - Test: playwright done diff --git a/package-lock.json b/package-lock.json index d8fa35b..16ec001 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.808", + "version": "1.6.809", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.808", + "version": "1.6.809", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index d459889..333acc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.808", + "version": "1.6.809", "private": true, "scripts": { "dev": "next dev -p 3000", diff --git a/playwright/components/footer.ts b/playwright/components/footerTest.ts similarity index 100% rename from playwright/components/footer.ts rename to playwright/components/footerTest.ts diff --git a/playwright/components/header.ts b/playwright/components/headerTest.ts similarity index 100% rename from playwright/components/header.ts rename to playwright/components/headerTest.ts diff --git a/playwright/components/nav.ts b/playwright/components/nav.ts deleted file mode 100644 index e69de29..0000000 diff --git a/playwright/components/navTest.ts b/playwright/components/navTest.ts new file mode 100644 index 0000000..2bbe84f --- /dev/null +++ b/playwright/components/navTest.ts @@ -0,0 +1,38 @@ +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; + +export async function navTest(page: Page) { + await page.goto("http://localhost:3000/dashboard"); + 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" }) + ); + await highlightAndExpectVisible( + page, + page.getByRole("link", { name: "System" }) + ); + await highlightAndExpectVisible( + page, + page.getByRole("link", { name: "Einstellungen" }) + ); +} diff --git a/playwright/tests/pages/dashboard/dashboardTest.ts b/playwright/tests/pages/dashboard/dashboardTest.ts index 01aff38..b58de78 100644 --- a/playwright/tests/pages/dashboard/dashboardTest.ts +++ b/playwright/tests/pages/dashboard/dashboardTest.ts @@ -1,5 +1,5 @@ -import type { Locator, Page } from "@playwright/test"; -import { expect } from "@playwright/test"; +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; export async function runDashboardTest(page: Page) { await page.goto("http://localhost:3000/dashboard"); @@ -202,40 +202,3 @@ export async function runDashboardTest(page: Page) { } //--------------------------------------------------------------------- - -export async function highlightAndExpectVisible( - page: Page, - locator: Locator, - durationMs = 800 -) { - // CSS nur einmal pro Page injizieren - const alreadyInjected = await page.evaluate( - () => (window as any).__pwForceCssInjected === true - ); - - if (!alreadyInjected) { - await page.addStyleTag({ - content: ` - .pw-force-outline { - outline: 3px solid #ff1744 !important; - outline-offset: 2px !important; - box-shadow: 0 0 0 3px rgba(224,0,43,.35) !important; - } - `, - }); - await page.evaluate(() => { - (window as any).__pwForceCssInjected = true; - }); - } - - const els = await locator.elementHandles(); - for (const el of els) { - await el.evaluate((node: unknown, ms: number) => { - const n = node as HTMLElement; - n.classList.add("pw-force-outline"); - window.setTimeout(() => n.classList.remove("pw-force-outline"), ms); - }, durationMs); - } - - await expect(locator).toBeVisible(); -} diff --git a/playwright/tests/pages/digitalOutputs/digitalOutputsTest.ts b/playwright/tests/pages/digitalOutputs/digitalOutputsTest.ts index e9e7a19..edd30f5 100644 --- a/playwright/tests/pages/digitalOutputs/digitalOutputsTest.ts +++ b/playwright/tests/pages/digitalOutputs/digitalOutputsTest.ts @@ -1,5 +1,6 @@ -import type { Locator, Page } from "@playwright/test"; +import type { Page } from "@playwright/test"; import { expect } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; export async function runDigitalOutputsTest(page: Page) { await page.goto("/digitalOutputs"); @@ -210,40 +211,3 @@ export async function runDigitalOutputsTest(page: Page) { } //--------------------------------------------------------------------- - -export async function highlightAndExpectVisible( - page: Page, - locator: Locator, - durationMs = 800 -) { - // CSS nur einmal pro Page injizieren - const alreadyInjected = await page.evaluate( - () => (window as any).__pwForceCssInjected === true - ); - - if (!alreadyInjected) { - await page.addStyleTag({ - content: ` - .pw-force-outline { - outline: 3px solid #ff1744 !important; - outline-offset: 2px !important; - box-shadow: 0 0 0 3px rgba(224,0,43,.35) !important; - } - `, - }); - await page.evaluate(() => { - (window as any).__pwForceCssInjected = true; - }); - } - - const els = await locator.elementHandles(); - for (const el of els) { - await el.evaluate((node: unknown, ms: number) => { - const n = node as HTMLElement; - n.classList.add("pw-force-outline"); - window.setTimeout(() => n.classList.remove("pw-force-outline"), ms); - }, durationMs); - } - - await expect(locator).toBeVisible(); -} diff --git a/playwright/tests/pages/kabelueberwachung/kabelueberwachungTest.ts b/playwright/tests/pages/kabelueberwachung/kabelueberwachungTest.ts index 0bb009c..5d86295 100644 --- a/playwright/tests/pages/kabelueberwachung/kabelueberwachungTest.ts +++ b/playwright/tests/pages/kabelueberwachung/kabelueberwachungTest.ts @@ -1,5 +1,5 @@ -import type { Locator, Page } from "@playwright/test"; -import { expect } from "@playwright/test"; +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; export async function runCableMonitoringTest(page: Page) { await page.goto("/kabelueberwachung"); @@ -378,40 +378,3 @@ export async function runCableMonitoringTest(page: Page) { } //--------------------------------------------------------------------- - -export async function highlightAndExpectVisible( - page: Page, - locator: Locator, - durationMs = 800 -) { - // CSS nur einmal pro Page injizieren - const alreadyInjected = await page.evaluate( - () => (window as any).__pwForceCssInjected === true - ); - - if (!alreadyInjected) { - await page.addStyleTag({ - content: ` - .pw-force-outline { - outline: 3px solid #ff1744 !important; - outline-offset: 2px !important; - box-shadow: 0 0 0 3px rgba(224,0,43,.35) !important; - } - `, - }); - await page.evaluate(() => { - (window as any).__pwForceCssInjected = true; - }); - } - - const els = await locator.elementHandles(); - for (const el of els) { - await el.evaluate((node: unknown, ms: number) => { - const n = node as HTMLElement; - n.classList.add("pw-force-outline"); - window.setTimeout(() => n.classList.remove("pw-force-outline"), ms); - }, durationMs); - } - - await expect(locator).toBeVisible(); -} diff --git a/playwright/tests/pages/meldungen/meldungenTest.ts b/playwright/tests/pages/meldungen/meldungenTest.ts index e21b5b6..36d947a 100644 --- a/playwright/tests/pages/meldungen/meldungenTest.ts +++ b/playwright/tests/pages/meldungen/meldungenTest.ts @@ -1,4 +1,4 @@ -import type { Locator, Page } from "@playwright/test"; +import type { Page } from "@playwright/test"; import { expect } from "@playwright/test"; import { highlightAndExpectVisible } from "@playwright/utils/highlight"; diff --git a/playwright/tests/pages/settingsPage/settingsPageTest.ts b/playwright/tests/pages/settingsPage/settingsPageTest.ts index 40776eb..3624118 100644 --- a/playwright/tests/pages/settingsPage/settingsPageTest.ts +++ b/playwright/tests/pages/settingsPage/settingsPageTest.ts @@ -1,5 +1,5 @@ -import type { Locator, Page } from "@playwright/test"; -import { expect } from "@playwright/test"; +import type { Page } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; export async function runSettingsPageTest(page: Page) { await page.goto("http://localhost:3000/einstellungen"); @@ -259,42 +259,3 @@ export async function runSettingsPageTest(page: Page) { } //--------------------------------------------------------------------- - -export async function highlightAndExpectVisible( - page: Page, - locator: Locator, - durationMs = 800 -) { - // CSS nur einmal pro Page injizieren - const alreadyInjected = await page.evaluate( - () => (window as any).__pwForceCssInjected === true - ); - - if (!alreadyInjected) { - await page.addStyleTag({ - content: ` - .pw-force-outline { - outline: 3px solid #ff1744 !important; - outline-offset: 2px !important; - box-shadow: 0 0 0 3px rgba(224,0,43,.35) !important; - } - `, - }); - await page.evaluate(() => { - (window as any).__pwForceCssInjected = true; - }); - } - - // Erst prüfen, ob das Element sichtbar ist, sonst bricht der Test sauber ab - await expect(locator).toBeVisible({ timeout: 10000 }); - const els = await locator.elementHandles(); - for (const el of els) { - await el.evaluate((node: unknown, ms: number) => { - const n = node as HTMLElement; - n.classList.add("pw-force-outline"); - window.setTimeout(() => n.classList.remove("pw-force-outline"), ms); - }, durationMs); - } - - await expect(locator).toBeVisible(); -} diff --git a/playwright/tests/pages/system/systemTest.ts b/playwright/tests/pages/system/systemTest.ts index f1c23cf..4126a84 100644 --- a/playwright/tests/pages/system/systemTest.ts +++ b/playwright/tests/pages/system/systemTest.ts @@ -1,5 +1,6 @@ -import type { Locator, Page } from "@playwright/test"; +import type { Page } from "@playwright/test"; import { expect } from "@playwright/test"; +import { highlightAndExpectVisible } from "@playwright/utils/highlight"; export async function runSystemTest(page: Page) { await page.goto("/system"); @@ -143,40 +144,3 @@ export async function runSystemTest(page: Page) { } //--------------------------------------------------------------------- - -export async function highlightAndExpectVisible( - page: Page, - locator: Locator, - durationMs = 800 -) { - // CSS nur einmal pro Page injizieren - const alreadyInjected = await page.evaluate( - () => (window as any).__pwForceCssInjected === true - ); - - if (!alreadyInjected) { - await page.addStyleTag({ - content: ` - .pw-force-outline { - outline: 3px solid #ff1744 !important; - outline-offset: 2px !important; - box-shadow: 0 0 0 3px rgba(224,0,43,.35) !important; - } - `, - }); - await page.evaluate(() => { - (window as any).__pwForceCssInjected = true; - }); - } - - const els = await locator.elementHandles(); - for (const el of els) { - await el.evaluate((node: unknown, ms: number) => { - const n = node as HTMLElement; - n.classList.add("pw-force-outline"); - window.setTimeout(() => n.classList.remove("pw-force-outline"), ms); - }, durationMs); - } - - await expect(locator).toBeVisible(); -}