chore: move playwright components folder to tests
This commit is contained in:
56
playwright/tests/components/footer/footerTest.ts
Normal file
56
playwright/tests/components/footer/footerTest.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
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"));
|
||||
await page.getByRole("contentinfo").getByRole("button").click();
|
||||
}
|
||||
14
playwright/tests/components/header/headerTest.ts
Normal file
14
playwright/tests/components/header/headerTest.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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 })
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
test("AnalogInputsChartModal opens after clicking chart button", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/analogInputs");
|
||||
// Öffne Modal via Chart-Button (📈)
|
||||
await highlightAndExpectVisible(
|
||||
page,
|
||||
page.getByRole("button", { name: "Messkurve anzeigen" })
|
||||
);
|
||||
await page
|
||||
.getByRole("button", { name: "Messkurve anzeigen" })
|
||||
.first()
|
||||
.click();
|
||||
await highlightAndExpectVisible(page, page.getByRole("dialog"));
|
||||
await expect(page.getByRole("dialog")).toBeVisible();
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
test("AnalogInputsDatePicker renders two inputs", async ({ page }) => {
|
||||
await page.goto("/analogInputs");
|
||||
// Öffne erst die Chart-Ansicht (enthält den DatePicker)
|
||||
const chartBtn = page
|
||||
.getByRole("button", { name: "Messkurve anzeigen" })
|
||||
.first();
|
||||
await highlightAndExpectVisible(page, chartBtn);
|
||||
await chartBtn.click();
|
||||
await highlightAndExpectVisible(page, page.getByRole("dialog"));
|
||||
await highlightAndExpectVisible(page, page.getByText("Von"));
|
||||
await highlightAndExpectVisible(page, page.getByText("Bis"));
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
test("AnalogInputsSettingsModal opens after clicking settings", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/analogInputs");
|
||||
// Wähle die erste Tabellenzeile und in der 5. Spalte (Einstellungen) den Button
|
||||
const firstRow = page.locator("table tbody tr").first();
|
||||
const settingsButton = firstRow.locator("td").nth(4).locator("button");
|
||||
await highlightAndExpectVisible(page, settingsButton);
|
||||
await settingsButton.click();
|
||||
await highlightAndExpectVisible(
|
||||
page,
|
||||
page.getByRole("button", { name: "Modal schließen" })
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
test("AnalogInputsTable renders rows", async ({ page }) => {
|
||||
await page.goto("/analogInputs");
|
||||
await highlightAndExpectVisible(page, page.getByRole("table"));
|
||||
// Mindestens eine Tabellenzeile sichtbar
|
||||
await highlightAndExpectVisible(page, page.locator("tbody tr").first());
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
test("AnalogInputsView shows heading and table", async ({ page }) => {
|
||||
await page.goto("/analogInputs");
|
||||
await highlightAndExpectVisible(
|
||||
page,
|
||||
page.getByRole("heading", { name: "Messwerteingänge" })
|
||||
);
|
||||
await highlightAndExpectVisible(page, page.getByRole("table"));
|
||||
await expect(page.getByRole("table")).toBeVisible();
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
import { test } from "@playwright/test";
|
||||
|
||||
test.fixme("XioPM visual presence", async ({ page }) => {
|
||||
await page.goto("/analogInputs");
|
||||
});
|
||||
57
playwright/tests/components/navigation/navTest.ts
Normal file
57
playwright/tests/components/navigation/navTest.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
|
||||
export async function navTest(page: Page) {
|
||||
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" })
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
// 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);
|
||||
}
|
||||
*/
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
// Kombinierte Helper-Funktion: injiziert CSS (nur einmal), hebt hervor und prüft Sichtbarkeit
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runDashboardTest(page: Page) {
|
||||
await page.goto("/dashboard");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runDigitalInputsTest(page: Page) {
|
||||
await page.goto("/digitalInputs");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runDigitalOutputsTest(page: Page) {
|
||||
await page.goto("/digitalOutputs");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runCableMonitoringTest(page: Page) {
|
||||
await page.goto("/kabelueberwachung");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runMeldungenTest(page: Page) {
|
||||
await page.goto("/meldungen");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runSettingsPageTest(page: Page) {
|
||||
await page.goto("/einstellungen");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { highlightAndExpectVisible } from "@playwright/utils/highlight";
|
||||
import { navTest } from "@/playwright/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/components/footer/footerTest";
|
||||
import { navTest } from "@/playwright/tests/components/navigation/navTest";
|
||||
import { headerTest } from "@/playwright/tests/components/header/headerTest";
|
||||
import { footerTest } from "@/playwright/tests/components/footer/footerTest";
|
||||
|
||||
export async function runSystemTest(page: Page) {
|
||||
await page.goto("/system");
|
||||
|
||||
Reference in New Issue
Block a user