← snapshot
1362 bytes
/** Imports a real PR through the UI and checks the report is honest. */
import { chromium } from "@playwright/test";
const b = await chromium.launch();
const p = await b.newPage({ viewport: { width: 1400, height: 1100 }, colorScheme: "dark" });
const errs = [];
p.on("pageerror", e => errs.push(e.message));
p.on("console", m => { if (m.type()==="error") errs.push(m.text()); });
await p.goto("http://localhost:3000/import", { waitUntil: "networkidle" });
await p.fill("#imp-pr", "3495");
await p.locator("button", { hasText: "Import it" }).click();
await p.waitForSelector(".jac-import-report", { timeout: 120000 });
await p.waitForTimeout(800);
const info = await p.evaluate(() => ({
heading: document.querySelector(".jac-import-report .jac-h2")?.textContent,
assumed: document.querySelector(".jac-import-inference")?.dataset.assumed,
gapCount: document.querySelectorAll(".jac-import-gaps li").length,
gaps: [...document.querySelectorAll(".jac-import-ask")].map(x => x.textContent),
saysUnsettled: document.body.innerText.includes("proposed and unsettled"),
saysInferred: document.body.innerText.includes("inferred, not attested"),
}));
console.log(JSON.stringify(info, null, 2));
await p.screenshot({ path: "tour/lab/import.png", fullPage: true });
console.log("errors:", errs.length ? [...new Set(errs)].slice(0,3) : "none");
await b.close();