Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,52 @@
|
||||
import { chromium } from "playwright";
|
||||
import { mkdirSync } from "node:fs";
|
||||
|
||||
const BASE = "http://app.localhost:3000";
|
||||
const EMAIL = "e2e.readiness@example.test";
|
||||
const PASSWORD = "ReadinessPass123!";
|
||||
const OUT = "/tmp/shots";
|
||||
mkdirSync(OUT, { recursive: true });
|
||||
|
||||
const browser = await chromium.launch();
|
||||
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
||||
const page = await ctx.newPage();
|
||||
const consoleErrors = [];
|
||||
page.on("console", (m) => { if (m.type() === "error") consoleErrors.push(m.text()); });
|
||||
page.on("pageerror", (e) => consoleErrors.push("PAGEERROR: " + e.message));
|
||||
|
||||
await page.goto(`${BASE}/login`, { waitUntil: "domcontentloaded" });
|
||||
await page.fill('input[name="email"]', EMAIL);
|
||||
await page.fill('input[name="password"]', PASSWORD);
|
||||
await page.click('button[type="submit"]');
|
||||
await page.waitForURL(/dashboard|select-tenant|\/[a-z0-9-]+\//, { timeout: 15000 }).catch(() => {});
|
||||
await page.waitForTimeout(1200);
|
||||
const landing = page.url();
|
||||
console.log("landing:", landing);
|
||||
// Tenant-Slug aus der Landing-URL ableiten (host-aware: app.localhost:3000/<slug>/...)
|
||||
const m = landing.match(/app\.localhost:3000\/([a-z0-9-]+)\//);
|
||||
const tenant = "e2e-readiness"; void m;
|
||||
console.log("tenant:", tenant);
|
||||
|
||||
const screens = [
|
||||
["dashboard", `/${tenant}/dashboard`],
|
||||
["crm", `/${tenant}/crm`],
|
||||
["email-marketing", `/${tenant}/email-marketing`],
|
||||
["workflow-engine", `/${tenant}/workflow-engine`],
|
||||
["notifications", `/${tenant}/notifications`],
|
||||
["settings-members", `/${tenant}/settings/members`],
|
||||
["settings-subscription", `/${tenant}/settings/subscription`],
|
||||
["settings-account", `/${tenant}/settings/account`],
|
||||
];
|
||||
|
||||
for (const [name, path] of screens) {
|
||||
await page.goto(`${BASE}${path}`, { waitUntil: "networkidle", timeout: 20000 }).catch((e) => console.log(`goto FAIL ${name}: ${e.message}`));
|
||||
await page.waitForTimeout(700);
|
||||
const redirected = /\/login/.test(page.url());
|
||||
await page.screenshot({ path: `${OUT}/${name}.png`, fullPage: true });
|
||||
console.log(`shot ${name} <- ${page.url()}${redirected ? " [REDIRECTED TO LOGIN]" : ""}`);
|
||||
}
|
||||
|
||||
console.log("=== CONSOLE ERRORS (" + consoleErrors.length + ") ===");
|
||||
for (const e of [...new Set(consoleErrors)].slice(0, 30)) console.log(" " + e.slice(0, 160));
|
||||
|
||||
await browser.close();
|
||||
Reference in new issue
Block a user