import { expect, test, type Page, } from "../support/browser/strict-browser-test.ts"; // 11-02. The goldens were captured with these four faces. `fonts.conf` shows // Chromium only the directories that hold them; this check runs before the // screenshots so a missing or substituted font fails here with an install // hint instead of as a whole-page pixel diff. Probes sit in the real page so // they get its CSS (`--font-sans`) and `lang`, which decide the fallbacks. const expectedFaces = { latin: "Noto Sans", korean: "Noto Sans CJK KR", "korean-800": "Noto Sans CJK KR Black", code: "Liberation Mono", }; const installHint = [ "Visual tests must draw with the fonts the goldens were captured with.", "Debian/Ubuntu: sudo apt-get install -y fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation", "tests/visual/fonts.conf reads them from the Debian/Ubuntu font directories; other OSes have no Linux goldens.", ].join("\n"); async function drawnFaces(page: Page) { await page.goto("/"); await expect(page.getByRole("heading", { level: 1 })).toBeVisible(); await page.evaluate(() => { const probes = document.createElement("div"); probes.innerHTML = `
Clean Architecture Frontend
플랫폼구성화면상태
플랫폼구성화면상태
const value = 42;`;
document.body.append(probes);
});
const cdp = await page.context().newCDPSession(page);
await cdp.send("DOM.enable");
await cdp.send("CSS.enable");
const { root } = await cdp.send("DOM.getDocument");
const drawn: Record