← snapshot
2438 bytes
import { chromium } from "@playwright/test";
const b = await chromium.launch();
const p = await b.newPage({ viewport: { width: 1500, height: 1050 }, 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/repos/meridian-systems/weave", { waitUntil: "networkidle" });
await p.waitForSelector(".jac-weavep-row", { timeout: 20000 });
await p.waitForTimeout(1500);
const info = await p.evaluate(() => ({
rows: document.querySelectorAll(".jac-weavep-row").length,
kinds: [...new Set([...document.querySelectorAll(".jac-weavep-row")].map(r => r.dataset.kind))],
hands: [...new Set([...document.querySelectorAll(".jac-weavep-row")].map(r => r.dataset.hand))],
filters: [...document.querySelectorAll(".jac-weavep-filters .jac-seg button")].map(x => x.textContent.trim()),
files: document.querySelectorAll(".jac-weavep-files button").length,
}));
console.log(JSON.stringify(info, null, 2));
// Open a source file from inside a snapshot.
const f = p.locator(".jac-weavep-files button").first();
if (await f.count()) {
await f.click();
await p.waitForTimeout(900);
const src = await p.locator(".jac-weavep-source .jac-blob").textContent();
console.log("source shown:", JSON.stringify(src?.slice(0, 70)));
}
await p.screenshot({ path: "tour/lab/weave.png", fullPage: true });
// Filter to human hands only.
await p.locator(".jac-weavep-filters .jac-seg button", { hasText: /^human/ }).click();
await p.waitForTimeout(500);
const humanOnly = await p.evaluate(() =>
[...new Set([...document.querySelectorAll(".jac-weavep-row")].map(r => r.dataset.hand))]);
console.log("after human filter, hands shown:", humanOnly);
// Attestations should be reachable and rendered verbatim.
await p.locator(".jac-weavep-filters .jac-seg button", { hasText: /^attestation/ }).click();
await p.waitForTimeout(600);
const detailText = await p.evaluate(() => document.querySelector(".jac-weavep-card")?.innerText?.slice(0,300));
console.log("detail pane:", JSON.stringify(detailText));
const rows = await p.evaluate(() => [...document.querySelectorAll(".jac-weavep-row")].map(r=>r.dataset.kind));
console.log("rows after filter:", rows);
await p.screenshot({ path: "tour/lab/weave-attest.png", fullPage: true });
console.log("errors:", errs.length ? [...new Set(errs)].slice(0,3) : "none");
await b.close();