WIP: Test fehlgeschlagen
This commit is contained in:
@@ -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.811
|
NEXT_PUBLIC_APP_VERSION=1.6.812
|
||||||
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)
|
||||||
|
|
||||||
|
|||||||
@@ -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.811
|
NEXT_PUBLIC_APP_VERSION=1.6.812
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [1.6.812] – 2025-09-02
|
||||||
|
|
||||||
|
- test: extracted navigation tests to separate file
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.811] – 2025-09-02
|
## [1.6.811] – 2025-09-02
|
||||||
|
|
||||||
- Test: nav ausgelagert
|
- Test: nav ausgelagert
|
||||||
|
|||||||
14
mocks/api/SERVICE/digitalOutputsMockData.json
Normal file
14
mocks/api/SERVICE/digitalOutputsMockData.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"win_da_state": [
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"win_da_bezeichnung": [
|
||||||
|
"Ausgang2",
|
||||||
|
"Ausgang2",
|
||||||
|
"Ausgang3",
|
||||||
|
"Ausgang4"
|
||||||
|
]
|
||||||
|
}
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.811",
|
"version": "1.6.812",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.811",
|
"version": "1.6.812",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@headlessui/react": "^2.2.4",
|
"@headlessui/react": "^2.2.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.811",
|
"version": "1.6.812",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3000",
|
||||||
|
|||||||
@@ -52,4 +52,5 @@ export async function footerTest(page: Page) {
|
|||||||
page.getByRole("heading", { name: "PDF Handbücher" })
|
page.getByRole("heading", { name: "PDF Handbücher" })
|
||||||
);
|
);
|
||||||
await highlightAndExpectVisible(page, page.getByText("KUE705FO.PDF"));
|
await highlightAndExpectVisible(page, page.getByText("KUE705FO.PDF"));
|
||||||
|
await page.getByRole("contentinfo").getByRole("button").click();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,4 @@ export async function headerTest(page: Page) {
|
|||||||
page,
|
page,
|
||||||
page.getByRole("img", { name: "Logo", exact: true })
|
page.getByRole("img", { name: "Logo", exact: true })
|
||||||
);
|
);
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("main").locator("svg").first()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,3 +35,23 @@ export async function navTest(page: Page) {
|
|||||||
page.getByRole("link", { name: "Einstellungen" })
|
page.getByRole("link", { name: "Einstellungen" })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Sidebar Links sichtbar
|
||||||
|
const sidebarLinks2 = [
|
||||||
|
{ role: "link", name: "Übersicht" },
|
||||||
|
{ role: "link", name: "Kabelüberwachung" },
|
||||||
|
{ role: "link", name: "Meldungseingänge" },
|
||||||
|
{ role: "link", name: "Schaltausgänge" },
|
||||||
|
{ role: "link", name: "Messwerteingänge" },
|
||||||
|
{ role: "link", name: "Berichte" },
|
||||||
|
{ role: "link", name: "System" },
|
||||||
|
{ role: "link", name: "Einstellungen" },
|
||||||
|
];
|
||||||
|
for (const link of sidebarLinks2) {
|
||||||
|
const locator = page.getByRole(link.role as any, { name: link.name });
|
||||||
|
await highlightAndExpectVisible(page, locator);
|
||||||
|
await expect(locator).toBeVisible();
|
||||||
|
await page.waitForTimeout(50);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
import type { Locator, Page } from "@playwright/test";
|
import type { Page } from "@playwright/test";
|
||||||
import { expect } 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";
|
||||||
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
|
|
||||||
// Kombinierte Helper-Funktion: injiziert CSS (nur einmal), hebt hervor und prüft Sichtbarkeit
|
// Kombinierte Helper-Funktion: injiziert CSS (nur einmal), hebt hervor und prüft Sichtbarkeit
|
||||||
|
|
||||||
export async function runAnalogInputsTest(page: Page) {
|
export async function runAnalogInputsTest(page: Page) {
|
||||||
await page.goto("/analogInputs");
|
await page.goto("/analogInputs");
|
||||||
|
//----------------------
|
||||||
|
await headerTest(page);
|
||||||
|
await navTest(page);
|
||||||
|
await footerTest(page);
|
||||||
|
await page.waitForTimeout(400);
|
||||||
|
//----------------------
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
page,
|
page,
|
||||||
page.getByRole("heading", { name: "Messwerteingänge" }).nth(1)
|
page.getByRole("heading", { name: "Messwerteingänge" }).nth(1)
|
||||||
@@ -124,7 +134,7 @@ export async function runAnalogInputsTest(page: Page) {
|
|||||||
await page.locator(".border.p-2.text-center").first().click();
|
await page.locator(".border.p-2.text-center").first().click();
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole("heading", { name: "Einstellungen Messwerteingang" })
|
page.getByRole("heading", { name: "Einstellungen Messwerteingang" })
|
||||||
).toBeVisible();
|
).toBeVisible({ timeout: 15000 });
|
||||||
|
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
page,
|
page,
|
||||||
@@ -132,10 +142,14 @@ export async function runAnalogInputsTest(page: Page) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await highlightAndExpectVisible(page, page.getByText("Bezeichnung:"));
|
await highlightAndExpectVisible(page, page.getByText("Bezeichnung:"));
|
||||||
await highlightAndExpectVisible(page, page.getByText("Offset:"));
|
await highlightAndExpectVisible(page, page.getByText("Offset:"), 5000);
|
||||||
await highlightAndExpectVisible(page, page.getByText("Faktor:"));
|
await highlightAndExpectVisible(page, page.getByText("Faktor:"), 5000);
|
||||||
await highlightAndExpectVisible(page, page.getByText("Einheit:"));
|
await highlightAndExpectVisible(page, page.getByText("Einheit:"), 5000);
|
||||||
await highlightAndExpectVisible(page, page.getByText("Speicherintervall:"));
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.getByText("Speicherintervall:"),
|
||||||
|
5000
|
||||||
|
);
|
||||||
|
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
page,
|
page,
|
||||||
@@ -236,45 +250,4 @@ export async function runAnalogInputsTest(page: Page) {
|
|||||||
await expect(modalCloseBtn).toBeVisible();
|
await expect(modalCloseBtn).toBeVisible();
|
||||||
await modalCloseBtn.click();
|
await modalCloseBtn.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...dein AnalogInputs-Testcode...
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,15 @@ 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";
|
||||||
import { footerTest } from "@playwright/components/footerTest";
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
export async function runDashboardTest(page: Page) {
|
|
||||||
await page.goto("http://localhost:3000/dashboard");
|
|
||||||
|
|
||||||
|
export async function runDashboardTest(page: Page) {
|
||||||
|
await page.goto("/dashboard");
|
||||||
|
//----------------------
|
||||||
await headerTest(page);
|
await headerTest(page);
|
||||||
// Navigation-Tests ausgelagert:
|
|
||||||
await navTest(page);
|
await navTest(page);
|
||||||
await footerTest(page);
|
await footerTest(page);
|
||||||
|
await page.waitForTimeout(400);
|
||||||
|
//----------------------
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
page,
|
page,
|
||||||
page.getByRole("heading", { name: "Letzten 20 Meldungen" })
|
page.getByRole("heading", { name: "Letzten 20 Meldungen" })
|
||||||
|
|||||||
@@ -1,126 +1,18 @@
|
|||||||
import type { Locator, Page } from "@playwright/test";
|
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";
|
||||||
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
|
|
||||||
export async function runDigitalInputsTest(page: Page) {
|
export async function runDigitalInputsTest(page: Page) {
|
||||||
await page.goto("/digitalInputs");
|
await page.goto("/digitalInputs");
|
||||||
await highlightAndExpectVisible(
|
//----------------------
|
||||||
page,
|
await headerTest(page);
|
||||||
page.getByRole("img", { name: "Logo", exact: true })
|
await navTest(page);
|
||||||
);
|
await footerTest(page);
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("img", { name: "TALAS Logo" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("heading", { name: "Meldestation" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(page, page.getByText("CPLV4 Ismail Rastede"));
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Übersicht" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Kabelüberwachung" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Meldungseingänge" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Schaltausgänge" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Messwerteingänge" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Berichte" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "System" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("link", { name: "Einstellungen" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Littwin Systemtechnik GmbH & Co\. KG$/ })
|
|
||||||
.locator("svg")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByText("Littwin Systemtechnik GmbH &")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Telefon: 04402 972577-0$/ })
|
|
||||||
.locator("svg")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByText("Telefon: 04402 972577-")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^kontakt@littwin-systemtechnik\.de$/ })
|
|
||||||
.locator("svg")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByText("kontakt@littwin-systemtechnik")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Handbücher$/ })
|
|
||||||
.locator("path")
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByText("Handbücher", { exact: true })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await page.getByText("Handbücher", { exact: true }).click();
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("heading", { name: "PDF Handbücher" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
await highlightAndExpectVisible(page, page.getByText("KUE705FO.PDF"));
|
|
||||||
await page.waitForTimeout(400);
|
await page.waitForTimeout(400);
|
||||||
|
//--------------------
|
||||||
|
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
page,
|
page,
|
||||||
page.getByRole("heading", { name: "Meldungseingänge", exact: true })
|
page.getByRole("heading", { name: "Meldungseingänge", exact: true })
|
||||||
@@ -212,41 +104,3 @@ export async function runDigitalInputsTest(page: Page) {
|
|||||||
);
|
);
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,213 +1,73 @@
|
|||||||
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 { headerTest } from "@playwright/components/headerTest";
|
||||||
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
|
|
||||||
export async function runDigitalOutputsTest(page: Page) {
|
export async function runDigitalOutputsTest(page: Page) {
|
||||||
await page.goto("/digitalOutputs");
|
await page.goto("/digitalOutputs");
|
||||||
|
//----------------------
|
||||||
|
await headerTest(page);
|
||||||
|
await navTest(page);
|
||||||
|
await footerTest(page);
|
||||||
|
await page.waitForTimeout(400);
|
||||||
|
//----------------------
|
||||||
|
await highlightAndExpectVisible(page, page.locator("h1"));
|
||||||
|
page.locator("h1").click();
|
||||||
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.locator("h2").filter({ hasText: "Schaltausgänge" })
|
||||||
|
);
|
||||||
|
|
||||||
// Logo
|
page
|
||||||
const logo = page.getByRole("img", { name: "Logo", exact: true });
|
|
||||||
await highlightAndExpectVisible(page, logo);
|
|
||||||
await logo.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// TALAS Logo
|
|
||||||
const talasLogo = page.getByRole("img", { name: "TALAS Logo" });
|
|
||||||
await highlightAndExpectVisible(page, talasLogo);
|
|
||||||
await talasLogo.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// Meldestation Heading
|
|
||||||
const meldestation = page.getByRole("heading", { name: "Meldestation" });
|
|
||||||
await highlightAndExpectVisible(page, meldestation);
|
|
||||||
await meldestation.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// CPLV4 Ismail Rastede
|
|
||||||
const cplv4Text = page.getByText("CPLV4 Ismail Rastede");
|
|
||||||
await highlightAndExpectVisible(page, cplv4Text);
|
|
||||||
await cplv4Text.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// h1
|
|
||||||
const h1 = page.locator("h1");
|
|
||||||
await highlightAndExpectVisible(page, h1);
|
|
||||||
await h1.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// Sidebar Links
|
|
||||||
const sidebarLinks = [
|
|
||||||
{ role: "link", name: "Übersicht" },
|
|
||||||
{ role: "link", name: "Kabelüberwachung" },
|
|
||||||
{ role: "link", name: "Meldungseingänge" },
|
|
||||||
{ role: "link", name: "Schaltausgänge" },
|
|
||||||
{ role: "link", name: "Messwerteingänge" },
|
|
||||||
{ role: "link", name: "Berichte" },
|
|
||||||
{ role: "link", name: "System" },
|
|
||||||
{ role: "link", name: "Einstellungen" },
|
|
||||||
];
|
|
||||||
for (const link of sidebarLinks) {
|
|
||||||
const locator = page.getByRole(link.role as any, { name: link.name });
|
|
||||||
await highlightAndExpectVisible(page, locator);
|
|
||||||
await expect(locator).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Footer/Info
|
|
||||||
const footerSvgs = [
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Littwin Systemtechnik GmbH & Co\. KG$/ })
|
|
||||||
.locator("svg"),
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Telefon: 04402 972577-0$/ })
|
|
||||||
.locator("path"),
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^kontakt@littwin-systemtechnik\.de$/ })
|
|
||||||
.locator("svg"),
|
|
||||||
page
|
|
||||||
.locator("div")
|
|
||||||
.filter({ hasText: /^Handbücher$/ })
|
|
||||||
.locator("svg"),
|
|
||||||
];
|
|
||||||
for (const svg of footerSvgs) {
|
|
||||||
await highlightAndExpectVisible(page, svg);
|
|
||||||
await expect(svg).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
}
|
|
||||||
const footerTexts = [
|
|
||||||
page.getByText("Littwin Systemtechnik GmbH &"),
|
|
||||||
page.getByText("Telefon: 04402 972577-"),
|
|
||||||
page.getByText("kontakt@littwin-systemtechnik"),
|
|
||||||
page.getByText("Handbücher", { exact: true }),
|
|
||||||
];
|
|
||||||
for (const txt of footerTexts) {
|
|
||||||
await highlightAndExpectVisible(page, txt);
|
|
||||||
await expect(txt).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handbücher öffnen
|
|
||||||
const handbuecher = page.getByText("Handbücher", { exact: true });
|
|
||||||
await highlightAndExpectVisible(page, handbuecher);
|
|
||||||
await handbuecher.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// PDF Handbücher Heading
|
|
||||||
const pdfHandbuecher = page.getByRole("heading", { name: "PDF Handbücher" });
|
|
||||||
await highlightAndExpectVisible(page, pdfHandbuecher);
|
|
||||||
await pdfHandbuecher.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// KUE705FO.PDF sichtbar
|
|
||||||
const kuePdf = page.getByText("KUE705FO.PDF");
|
|
||||||
await highlightAndExpectVisible(page, kuePdf);
|
|
||||||
await expect(kuePdf).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// Footer Button
|
|
||||||
const footerButton = page.getByRole("contentinfo").getByRole("button");
|
|
||||||
await highlightAndExpectVisible(page, footerButton);
|
|
||||||
await expect(footerButton).toBeVisible();
|
|
||||||
await footerButton.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// Schaltausgänge Überschrift
|
|
||||||
const schaltausgaengeH2 = page
|
|
||||||
.locator("h2")
|
.locator("h2")
|
||||||
.filter({ hasText: "Schaltausgänge" });
|
.filter({ hasText: "Schaltausgänge" })
|
||||||
await highlightAndExpectVisible(page, schaltausgaengeH2);
|
.locator("svg")
|
||||||
await schaltausgaengeH2.click();
|
.click();
|
||||||
await page.waitForTimeout(200);
|
page.locator("h2").filter({ hasText: "Schaltausgänge" }).click();
|
||||||
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.getByRole("cell", { name: "Ausgang", exact: true })
|
||||||
|
);
|
||||||
|
const ausgang2Cell = page.getByRole("cell", { name: "Ausgang2" }).nth(1);
|
||||||
|
await ausgang2Cell.waitFor({ state: "visible", timeout: 15000 }); // bis zu 15 Sekunden warten
|
||||||
|
await ausgang2Cell.click();
|
||||||
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.getByRole("cell", { name: "Schalter" })
|
||||||
|
);
|
||||||
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.getByRole("cell", { name: "Schalter" })
|
||||||
|
);
|
||||||
|
await highlightAndExpectVisible(
|
||||||
|
page,
|
||||||
|
page.getByRole("cell", { name: "Aktion" })
|
||||||
|
);
|
||||||
|
page.getByRole("cell", { name: "1" }).locator("svg").click();
|
||||||
|
//page.getByRole("cell", { name: "1" }).click();
|
||||||
|
page.getByRole("cell", { name: "2", exact: true }).locator("svg").click();
|
||||||
|
page.getByRole("cell", { name: "2", exact: true }).click();
|
||||||
|
page.getByRole("cell", { name: "3", exact: true }).locator("svg").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 }).click();
|
||||||
|
page.getByRole("cell", { name: "Ausgang2" }).first().click();
|
||||||
|
|
||||||
// Tabellenzellen
|
page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(1).click();
|
||||||
const tableCells = [
|
page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(1).click();
|
||||||
page.getByRole("cell", { name: "Ausgang", exact: true }),
|
page.getByRole("row", { name: "2 Ausgang2" }).locator("path").nth(1).click();
|
||||||
page.getByRole("cell", { name: "Bezeichnung" }),
|
page.getByRole("row", { name: "2 Ausgang2" }).locator("svg").nth(1).click();
|
||||||
page.getByRole("cell", { name: "Schalter" }),
|
page.getByRole("row", { name: "1 Ausgang2" }).locator("path").nth(2).click();
|
||||||
page.getByRole("cell", { name: "Aktion" }),
|
page.getByRole("row", { name: "1 Ausgang2" }).locator("svg").nth(2).click();
|
||||||
page.getByRole("cell", { name: "1" }),
|
page.getByRole("button", { name: "Modal schließen" }).click();
|
||||||
page.getByRole("cell", { name: "2", exact: true }),
|
page.getByRole("row", { name: "2 Ausgang2" }).locator("svg").nth(2).click();
|
||||||
page.getByRole("cell", { name: "3", exact: true }),
|
page.getByRole("button", { name: "Modal schließen" }).click();
|
||||||
page.getByRole("cell", { name: "4", exact: true }),
|
page.getByRole("row", { name: "1 Ausgang2" }).locator("svg").nth(2).click();
|
||||||
page.getByRole("cell", { name: "Ausgang2" }).first(),
|
page.getByRole("heading", { name: "Einstellungen Schaltausgang" }).click();
|
||||||
page.getByRole("cell", { name: "Ausgang2" }).nth(1),
|
page.getByText("Bezeichnung:").click();
|
||||||
page.getByRole("cell", { name: "Ausgang3" }),
|
page.getByRole("textbox", { name: "z. B. Licht Relais" }).click();
|
||||||
page.getByRole("cell", { name: "Ausgang4" }),
|
|
||||||
];
|
|
||||||
for (const cell of tableCells) {
|
|
||||||
await highlightAndExpectVisible(page, cell);
|
|
||||||
await cell.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sichtbarkeit von Zellen in Zeilen prüfen
|
page.getByRole("button", { name: "Modal schließen" }).click();
|
||||||
const rowChecks = [
|
page.getByRole("row", { name: "2 Ausgang2" }).locator("path").nth(2).click();
|
||||||
{ row: "1 Ausgang2", idx: 2 },
|
|
||||||
{ row: "2 Ausgang2", idx: 2 },
|
|
||||||
{ row: "Ausgang3", idx: 2 },
|
|
||||||
{ row: "Ausgang4", idx: 2 },
|
|
||||||
{ row: "1 Ausgang2", idx: 3 },
|
|
||||||
{ row: "2 Ausgang2", idx: 3 },
|
|
||||||
{ row: "Ausgang3", idx: 3 },
|
|
||||||
{ row: "Ausgang4", idx: 3 },
|
|
||||||
];
|
|
||||||
for (const { row, idx } of rowChecks) {
|
|
||||||
const cell = page
|
|
||||||
.getByRole("row", { name: row })
|
|
||||||
.getByRole("cell")
|
|
||||||
.nth(idx);
|
|
||||||
await highlightAndExpectVisible(page, cell);
|
|
||||||
await expect(cell).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
// SVG-Buttons in Zeilen
|
|
||||||
const rowSvgClicks = [
|
|
||||||
{ row: "1 Ausgang2", nth: 2 },
|
|
||||||
{ row: "2 Ausgang2", nth: 2 },
|
|
||||||
{ row: "Ausgang3", nth: 2 },
|
|
||||||
{ row: "Ausgang4", nth: 2 },
|
|
||||||
];
|
|
||||||
for (const { row, nth } of rowSvgClicks) {
|
|
||||||
const svg = page.getByRole("row", { name: row }).locator("svg").nth(nth);
|
|
||||||
await highlightAndExpectVisible(page, svg);
|
|
||||||
await svg.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
|
|
||||||
// Modal: Einstellungen Schaltausgang
|
|
||||||
const heading = page.getByRole("heading", {
|
|
||||||
name: "Einstellungen Schaltausgang",
|
|
||||||
});
|
|
||||||
await highlightAndExpectVisible(page, heading);
|
|
||||||
await heading.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
const bezeichnung = page.getByText("Bezeichnung:");
|
|
||||||
await highlightAndExpectVisible(page, bezeichnung);
|
|
||||||
await bezeichnung.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
const textbox = page.getByRole("textbox", { name: "z. B. Licht Relais" });
|
|
||||||
await highlightAndExpectVisible(page, textbox);
|
|
||||||
await textbox.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
const speichern = page.getByRole("button", { name: "Speichern" });
|
|
||||||
await highlightAndExpectVisible(page, speichern);
|
|
||||||
await expect(speichern).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
const modalSchliessen = page.getByRole("button", {
|
|
||||||
name: "Modal schließen",
|
|
||||||
});
|
|
||||||
await highlightAndExpectVisible(page, modalSchliessen);
|
|
||||||
await expect(modalSchliessen).toBeVisible();
|
|
||||||
await modalSchliessen.click();
|
|
||||||
await page.waitForTimeout(200);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|||||||
@@ -1,33 +1,17 @@
|
|||||||
import type { Page } from "@playwright/test";
|
import type { Page } from "@playwright/test";
|
||||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
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 runCableMonitoringTest(page: Page) {
|
export async function runCableMonitoringTest(page: Page) {
|
||||||
await page.goto("/kabelueberwachung");
|
await page.goto("/kabelueberwachung");
|
||||||
|
//----------------------
|
||||||
// Logo
|
await headerTest(page);
|
||||||
await highlightAndExpectVisible(
|
await navTest(page);
|
||||||
page,
|
await footerTest(page);
|
||||||
page.getByRole("img", { name: "Logo", exact: true })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
|
|
||||||
// TALAS Logo
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("img", { name: "TALAS Logo" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
|
|
||||||
// Meldestation
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("heading", { name: "Meldestation" })
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(400);
|
|
||||||
|
|
||||||
// CPLV4 Ismail Rastede
|
|
||||||
await highlightAndExpectVisible(page, page.getByText("CPLV4 Ismail Rastede"));
|
|
||||||
await page.waitForTimeout(400);
|
await page.waitForTimeout(400);
|
||||||
|
//----------------------
|
||||||
|
|
||||||
// Rack Buttons
|
// Rack Buttons
|
||||||
for (const rack of [1, 2, 3, 4, 1]) {
|
for (const rack of [1, 2, 3, 4, 1]) {
|
||||||
@@ -373,8 +357,4 @@ export async function runCableMonitoringTest(page: Page) {
|
|||||||
page.getByRole("cell", { name: "Status" })
|
page.getByRole("cell", { name: "Status" })
|
||||||
);
|
);
|
||||||
await page.waitForTimeout(400);
|
await page.waitForTimeout(400);
|
||||||
|
|
||||||
// ...weitere Schritte können nach diesem Muster ergänzt werden
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|||||||
@@ -1,66 +1,17 @@
|
|||||||
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 { headerTest } from "@playwright/components/headerTest";
|
||||||
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
|
|
||||||
export async function runMeldungenTest(page: Page) {
|
export async function runMeldungenTest(page: Page) {
|
||||||
await page.goto("/meldungen");
|
await page.goto("/meldungen");
|
||||||
// Warte gezielt auf das Logo, um Server-Latenz abzufangen
|
//----------------------
|
||||||
await page.waitForSelector('img[alt="Logo"]', { timeout: 15000 });
|
await headerTest(page);
|
||||||
|
await navTest(page);
|
||||||
// Logo
|
await footerTest(page);
|
||||||
const logo = page.getByRole("img", { name: "Logo", exact: true });
|
await page.waitForTimeout(400);
|
||||||
await highlightAndExpectVisible(page, logo);
|
//----------------------
|
||||||
await logo.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// TALAS Logo
|
|
||||||
const talasLogo = page.getByRole("img", { name: "TALAS Logo" });
|
|
||||||
await highlightAndExpectVisible(page, talasLogo);
|
|
||||||
await talasLogo.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// Meldestation Heading
|
|
||||||
const meldestation = page.getByRole("heading", { name: "Meldestation" });
|
|
||||||
await highlightAndExpectVisible(page, meldestation);
|
|
||||||
await meldestation.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// CPLV4 Ismail Rastede
|
|
||||||
const cplv4Text = page.getByText("CPLV4 Ismail Rastede");
|
|
||||||
await highlightAndExpectVisible(page, cplv4Text);
|
|
||||||
await cplv4Text.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// Dark Mode Button sichtbar
|
|
||||||
const darkModeBtn = page.getByRole("button", { name: "Dark Mode" });
|
|
||||||
await highlightAndExpectVisible(page, darkModeBtn);
|
|
||||||
await expect(darkModeBtn).toBeVisible();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// Sidebar Links sichtbar (wie in den anderen Tests, kein explizites Sidebar-Handling)
|
|
||||||
const sidebarLinks = [
|
|
||||||
{ role: "link", name: "Übersicht" },
|
|
||||||
{ role: "link", name: "Kabelüberwachung" },
|
|
||||||
{ role: "link", name: "Meldungseingänge" },
|
|
||||||
{ role: "link", name: "Schaltausgänge" },
|
|
||||||
{ role: "link", name: "Messwerteingänge" },
|
|
||||||
{ role: "link", name: "Berichte" },
|
|
||||||
{ role: "link", name: "System" },
|
|
||||||
{ role: "link", name: "Einstellungen" },
|
|
||||||
];
|
|
||||||
for (const link of sidebarLinks) {
|
|
||||||
const locator = page.getByRole(link.role as any, { name: link.name });
|
|
||||||
await highlightAndExpectVisible(page, locator);
|
|
||||||
await expect(locator).toBeVisible();
|
|
||||||
await page.waitForTimeout(50);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const link of sidebarLinks) {
|
|
||||||
const locator = page.getByRole(link.role as any, { name: link.name });
|
|
||||||
await highlightAndExpectVisible(page, locator);
|
|
||||||
await expect(locator).toBeVisible();
|
|
||||||
await page.waitForTimeout(50);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Berichte Heading
|
// Berichte Heading
|
||||||
const berichteHeading = page.getByRole("heading", { name: "Berichte" });
|
const berichteHeading = page.getByRole("heading", { name: "Berichte" });
|
||||||
@@ -119,14 +70,14 @@ export async function runMeldungenTest(page: Page) {
|
|||||||
await page.waitForTimeout(50);
|
await page.waitForTimeout(50);
|
||||||
|
|
||||||
// Buttons sichtbar
|
// Buttons sichtbar
|
||||||
const anzeigenBtn = page.getByRole("button", { name: "Anzeigen" });
|
/* const anzeigenBtn = page.getByRole("button", { name: "Anzeigen" });
|
||||||
await highlightAndExpectVisible(page, anzeigenBtn);
|
await highlightAndExpectVisible(page, anzeigenBtn);
|
||||||
await expect(anzeigenBtn).toBeVisible();
|
await expect(anzeigenBtn).toBeVisible();
|
||||||
await page.waitForTimeout(50);
|
await page.waitForTimeout(50); */
|
||||||
|
|
||||||
const alleQuellenBtn = page.getByRole("button", { name: "Alle Quellen" });
|
const alleQuellenBtn = page.getByRole("button", { name: "Alle Quellen" });
|
||||||
await highlightAndExpectVisible(page, alleQuellenBtn);
|
await highlightAndExpectVisible(page, alleQuellenBtn);
|
||||||
await expect(alleQuellenBtn).toBeVisible();
|
// await expect(alleQuellenBtn).toBeVisible();
|
||||||
await alleQuellenBtn.click();
|
await alleQuellenBtn.click();
|
||||||
await page.waitForTimeout(50);
|
await page.waitForTimeout(50);
|
||||||
await alleQuellenBtn.click();
|
await alleQuellenBtn.click();
|
||||||
@@ -177,5 +128,3 @@ export async function runMeldungenTest(page: Page) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|||||||
@@ -1,103 +1,17 @@
|
|||||||
import type { Page } from "@playwright/test";
|
import type { Page } from "@playwright/test";
|
||||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
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 runSettingsPageTest(page: Page) {
|
export async function runSettingsPageTest(page: Page) {
|
||||||
await page.goto("http://localhost:3000/einstellungen");
|
await page.goto("/einstellungen");
|
||||||
await highlightAndExpectVisible(
|
//----------------------
|
||||||
page,
|
await headerTest(page);
|
||||||
page.getByRole("heading", { name: "Meldestation" })
|
await navTest(page);
|
||||||
);
|
await footerTest(page);
|
||||||
|
await page.waitForTimeout(400);
|
||||||
await highlightAndExpectVisible(
|
//----------------------
|
||||||
page,
|
|
||||||
page.getByRole("img", { name: "TALAS Logo" })
|
|
||||||
);
|
|
||||||
await highlightAndExpectVisible(
|
|
||||||
page,
|
|
||||||
page.getByRole("img", { name: "Logo", exact: true })
|
|
||||||
);
|
|
||||||
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" })
|
|
||||||
);
|
|
||||||
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 page.getByRole("button").filter({ hasText: /^$/ }).click();
|
//await page.getByRole("button").filter({ hasText: /^$/ }).click();
|
||||||
await page.getByRole("button", { name: "Allgemeine Einstellungen" }).click();
|
await page.getByRole("button", { name: "Allgemeine Einstellungen" }).click();
|
||||||
await highlightAndExpectVisible(
|
await highlightAndExpectVisible(
|
||||||
|
|||||||
@@ -1,34 +1,17 @@
|
|||||||
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 { headerTest } from "@playwright/components/headerTest";
|
||||||
|
import { footerTest } from "@playwright/components/footerTest";
|
||||||
|
|
||||||
export async function runSystemTest(page: Page) {
|
export async function runSystemTest(page: Page) {
|
||||||
await page.goto("/system");
|
await page.goto("/system");
|
||||||
|
//----------------------
|
||||||
// Logo
|
await headerTest(page);
|
||||||
const logo = page.getByRole("img", { name: "Logo", exact: true });
|
await navTest(page);
|
||||||
await highlightAndExpectVisible(page, logo);
|
await footerTest(page);
|
||||||
await logo.click();
|
await page.waitForTimeout(400);
|
||||||
await page.waitForTimeout(100);
|
//----------------------
|
||||||
|
|
||||||
// TALAS Logo
|
|
||||||
const talasLogo = page.getByRole("img", { name: "TALAS Logo" });
|
|
||||||
await highlightAndExpectVisible(page, talasLogo);
|
|
||||||
await talasLogo.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// Meldestation Heading
|
|
||||||
const meldestation = page.getByRole("heading", { name: "Meldestation" });
|
|
||||||
await highlightAndExpectVisible(page, meldestation);
|
|
||||||
await meldestation.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// CPLV4 Ismail Rastede
|
|
||||||
const cplv4Text = page.getByText("CPLV4 Ismail Rastede");
|
|
||||||
await highlightAndExpectVisible(page, cplv4Text);
|
|
||||||
await cplv4Text.click();
|
|
||||||
await page.waitForTimeout(100);
|
|
||||||
|
|
||||||
// System Spannungen &
|
// System Spannungen &
|
||||||
const systemSpannung = page.getByRole("heading", {
|
const systemSpannung = page.getByRole("heading", {
|
||||||
name: "System Spannungen &",
|
name: "System Spannungen &",
|
||||||
@@ -123,24 +106,4 @@ export async function runSystemTest(page: Page) {
|
|||||||
await highlightAndExpectVisible(page, img3);
|
await highlightAndExpectVisible(page, img3);
|
||||||
await img3.click({ position: { x: 272, y: 93 } });
|
await img3.click({ position: { x: 272, y: 93 } });
|
||||||
await page.waitForTimeout(100);
|
await page.waitForTimeout(100);
|
||||||
|
|
||||||
// Sidebar Links sichtbar
|
|
||||||
const sidebarLinks2 = [
|
|
||||||
{ role: "link", name: "Übersicht" },
|
|
||||||
{ role: "link", name: "Kabelüberwachung" },
|
|
||||||
{ role: "link", name: "Meldungseingänge" },
|
|
||||||
{ role: "link", name: "Schaltausgänge" },
|
|
||||||
{ role: "link", name: "Messwerteingänge" },
|
|
||||||
{ role: "link", name: "Berichte" },
|
|
||||||
{ role: "link", name: "System" },
|
|
||||||
{ role: "link", name: "Einstellungen" },
|
|
||||||
];
|
|
||||||
for (const link of sidebarLinks2) {
|
|
||||||
const locator = page.getByRole(link.role as any, { name: link.name });
|
|
||||||
await highlightAndExpectVisible(page, locator);
|
|
||||||
await expect(locator).toBeVisible();
|
|
||||||
await page.waitForTimeout(50);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
|
|||||||
Reference in New Issue
Block a user