playwright recording and testing
This commit is contained in:
56
tests/kabelueberwachung-visual.spec.ts
Normal file
56
tests/kabelueberwachung-visual.spec.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { test, expect, Page } from "@playwright/test";
|
||||
|
||||
// Simple visual smoke test for /kabelueberwachung
|
||||
// Creates / compares a full-page screenshot (baseline generated on first run with --update-snapshots)
|
||||
// To update baseline: npx playwright test tests/kabelueberwachung-visual.spec.ts --update-snapshots
|
||||
// To run in UI mode: npx playwright test --ui
|
||||
|
||||
// Helper to stabilize dynamic UI before screenshot
|
||||
|
||||
test.describe("Kabelüberwachung Visual", () => {
|
||||
test("test", async ({ page }) => {
|
||||
await page.goto("http://localhost:3000/kabelueberwachung");
|
||||
await page
|
||||
.locator(".bg-littwin-blue.text-white.text-\\[0\\.625rem\\]")
|
||||
.first()
|
||||
.click();
|
||||
//warte 1 Sekunde
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "Daten laden" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "Messkurve" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("option", { name: "Meldungen" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
page.once("dialog", (dialog) => {
|
||||
console.log(`Dialog message: ${dialog.message()}`);
|
||||
dialog.dismiss().catch(() => {});
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
await page.locator(".flex > button:nth-child(2)").first().click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "Messkurve" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("option", { name: "Meldungen" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page
|
||||
.locator(".bg-littwin-blue.text-white.cursor-pointer")
|
||||
.first()
|
||||
.click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "Messkurve" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("option", { name: "Meldungen" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
await page.getByRole("button", { name: "" }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
});
|
||||
//zum ausführen
|
||||
// npx playwright test kabelueberwachung-visual.spec.ts --project=chromium --headed
|
||||
//zum aufzeichnen
|
||||
// npx playwright codegen http://localhost:3000/kabelueberwachung --channel=chrome
|
||||
Reference in New Issue
Block a user