WIP: Test fehlgeschlagen
This commit is contained in:
@@ -1,66 +1,17 @@
|
||||
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 runMeldungenTest(page: Page) {
|
||||
await page.goto("/meldungen");
|
||||
// Warte gezielt auf das Logo, um Server-Latenz abzufangen
|
||||
await page.waitForSelector('img[alt="Logo"]', { timeout: 15000 });
|
||||
|
||||
// Logo
|
||||
const logo = page.getByRole("img", { name: "Logo", exact: true });
|
||||
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);
|
||||
}
|
||||
//----------------------
|
||||
await headerTest(page);
|
||||
await navTest(page);
|
||||
await footerTest(page);
|
||||
await page.waitForTimeout(400);
|
||||
//----------------------
|
||||
|
||||
// Berichte Heading
|
||||
const berichteHeading = page.getByRole("heading", { name: "Berichte" });
|
||||
@@ -119,14 +70,14 @@ export async function runMeldungenTest(page: Page) {
|
||||
await page.waitForTimeout(50);
|
||||
|
||||
// Buttons sichtbar
|
||||
const anzeigenBtn = page.getByRole("button", { name: "Anzeigen" });
|
||||
/* const anzeigenBtn = page.getByRole("button", { name: "Anzeigen" });
|
||||
await highlightAndExpectVisible(page, anzeigenBtn);
|
||||
await expect(anzeigenBtn).toBeVisible();
|
||||
await page.waitForTimeout(50);
|
||||
await page.waitForTimeout(50); */
|
||||
|
||||
const alleQuellenBtn = page.getByRole("button", { name: "Alle Quellen" });
|
||||
await highlightAndExpectVisible(page, alleQuellenBtn);
|
||||
await expect(alleQuellenBtn).toBeVisible();
|
||||
// await expect(alleQuellenBtn).toBeVisible();
|
||||
await alleQuellenBtn.click();
|
||||
await page.waitForTimeout(50);
|
||||
await alleQuellenBtn.click();
|
||||
@@ -177,5 +128,3 @@ export async function runMeldungenTest(page: Page) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user