Files

18 lines
1.2 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("core workspace actions remain usable across supported viewport widths", async ({ page }) => {
await page.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
for (const viewport of [{ width: 360, height: 800 }, { width: 390, height: 844 }, { width: 768, height: 900 }, { width: 1024, height: 768 }, { width: 1366, height: 768 }, { width: 1440, height: 900 }, { width: 1920, height: 1080 }]) {
await page.setViewportSize(viewport);
await expect(page.getByRole("button", { name: "Open .evtx", exact: true }).first()).toBeVisible();
for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) {
const button = page.getByRole("button", { name: workspace, exact: false }).first();
await button.click();
await expect(page.getByRole("heading", { name: workspace, exact: true })).toBeVisible();
const overflow = await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
expect(overflow, `horizontal overflow in ${workspace} at ${viewport.width}px`).toBeTruthy();
}
}
});