Files
CPLv4.0/playwright/tests/pages/digitalInputs/digitalInputs.test.ts

233 lines
5.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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: {
height: 1080,
width: 1920,
},
});
test("digitalInputs", async ({ page }) => {
await page.goto("/digitalInputs");
// Gemeinsame Layout-Checks
await headerTest(page);
await navTest(page);
await footerTest(page);
//Snapshot
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- heading "Meldungseingänge" [level=1]
- heading /Meldungseingänge 1 \\d+/ [level=2]
- table:
- rowgroup:
- row "Eingang Zustand Bezeichnung Aktion":
- cell "Eingang"
- cell "Zustand"
- cell "Bezeichnung"
- cell "Aktion"
- rowgroup:
- row "1 ● DE 1":
- cell "1"
- cell "●"
- cell "DE 1"
- cell
- row "2 ● DE 2":
- cell "2"
- cell "●"
- cell "DE 2"
- cell
- row "3 ● DE 3":
- cell "3"
- cell "●"
- cell "DE 3"
- cell
- row "4 ● DE 4":
- cell "4"
- cell "●"
- cell "DE 4"
- cell
- row "5 ● DE 5":
- cell "5"
- cell "●"
- cell "DE 5"
- cell
- row "6 ● DE 6":
- cell "6"
- cell "●"
- cell "DE 6"
- cell
- row "7 ● DE 7":
- cell "7"
- cell "●"
- cell "DE 7"
- cell
- row "8 ● DE 8":
- cell "8"
- cell "●"
- cell "DE 8"
- cell
- row "9 ● DE 9":
- cell "9"
- cell "●"
- cell "DE 9"
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- heading /Meldungseingänge \\d+ \\d+/ [level=2]
- table:
- rowgroup:
- row "Eingang Zustand Bezeichnung Aktion":
- cell "Eingang"
- cell "Zustand"
- cell "Bezeichnung"
- cell "Aktion"
- rowgroup:
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
- row /\\d+ ● DE \\d+/:
- cell /\\d+/
- cell "●"
- cell /DE \\d+/
- cell
`);
//Snapshot
await page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.getByRole("cell")
.nth(3)
.click();
await page
.getByRole("row", { name: "1 ● DE 1", exact: true })
.locator("svg")
.nth(1)
.click();
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- heading "Einstellungen Meldungseingang 1" [level=2]
- button "Modal schließen"
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(`
- text: "Bezeichnung:"
- textbox: DE 1
- text: "Invertierung:"
- switch [checked]
- text: "Ein Filterzeit:"
- spinbutton /Maximal \\d+ ms erlaubt/
- text: "ms Gewichtung:"
- spinbutton /Maximal \\d+ erlaubt/
- text: "Out of Service:"
- switch
- text: Aus
`);
await expect(page.getByRole("main")).toMatchAriaSnapshot(
`- button "Speichern"`
);
});