diff --git a/web/e2e/shots.mjs b/web/e2e/shots.mjs index a80cf52..6edc2d2 100644 --- a/web/e2e/shots.mjs +++ b/web/e2e/shots.mjs @@ -46,10 +46,14 @@ await call(`/workspaces/${wsId}/knowledge`, { title: "报销单必须贴发票 const me = await call("/workspaces/" + wsId + "/members", null, token, "GET").catch(() => null); +// 视口可覆盖,用来核对宽屏布局:VIEWPORT=2560x1400 SUFFIX=-wide node e2e/shots.mjs +const [VW, VH] = (process.env.VIEWPORT ?? "1440x960").split("x").map(Number); +const SUFFIX = process.env.SUFFIX ?? ""; + const browser = await chromium.launch({ executablePath: "C:\\Users\\Steven\\AppData\\Local\\ms-playwright\\chromium-1223\\chrome-win64\\chrome.exe", }); -const page = await browser.newPage({ viewport: { width: 1440, height: 960 }, deviceScaleFactor: 1 }); +const page = await browser.newPage({ viewport: { width: VW, height: VH }, deviceScaleFactor: 1 }); await page.goto(WEB + "/login"); await page.evaluate(([t, r]) => { localStorage.setItem("dadao.access", t); @@ -61,13 +65,17 @@ async function shot(url, name, prep) { await page.goto(WEB + url, { waitUntil: "networkidle" }); if (prep) await prep(); await page.waitForTimeout(600); - const file = `e2e/artifacts/ui-${name}.png`; + const file = `e2e/artifacts/ui-${name}${SUFFIX}.png`; await page.screenshot({ path: file, fullPage: false }); shots.push(file); } await shot("/", "home"); await shot(`/w/${wsId}`, "tasks"); +await shot(`/w/${wsId}`, "tasks-all", async () => { + await page.getByRole("button", { name: "全部", exact: true }).click(); + await page.waitForTimeout(500); +}); await shot(`/w/${wsId}/board`, "board"); await shot(`/w/${wsId}/tickets`, "tickets"); await shot(`/w/${wsId}/knowledge`, "knowledge"); diff --git a/web/src/components/AppShell.tsx b/web/src/components/AppShell.tsx index 0d46ef5..4191a27 100644 --- a/web/src/components/AppShell.tsx +++ b/web/src/components/AppShell.tsx @@ -105,7 +105,7 @@ export function AppShell({ return (
{/* —— 侧栏(桌面)—— */} -
) : ( -