test: extracted navigation tests to separate file

This commit is contained in:
ISA
2025-09-02 11:48:54 +02:00
parent 89dc26b0d2
commit fb79817136
8 changed files with 91 additions and 98 deletions

View File

@@ -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();
}
//---------------------------------------------------------------------