diff --git a/playground/screenshots/v2-mockup/artifact-dark.png b/playground/screenshots/v2-mockup/artifact-dark.png new file mode 100644 index 0000000..4a6d204 Binary files /dev/null and b/playground/screenshots/v2-mockup/artifact-dark.png differ diff --git a/playground/screenshots/v2-mockup/artifact-light.png b/playground/screenshots/v2-mockup/artifact-light.png new file mode 100644 index 0000000..ac29e75 Binary files /dev/null and b/playground/screenshots/v2-mockup/artifact-light.png differ diff --git a/playground/screenshots/v2-mockup/empty-dark.png b/playground/screenshots/v2-mockup/empty-dark.png new file mode 100644 index 0000000..22ebf60 Binary files /dev/null and b/playground/screenshots/v2-mockup/empty-dark.png differ diff --git a/playground/screenshots/v2-mockup/empty-light.png b/playground/screenshots/v2-mockup/empty-light.png new file mode 100644 index 0000000..ecd1e4a Binary files /dev/null and b/playground/screenshots/v2-mockup/empty-light.png differ diff --git a/playground/screenshots/v2-mockup/import-dark.png b/playground/screenshots/v2-mockup/import-dark.png new file mode 100644 index 0000000..0e1fcdf Binary files /dev/null and b/playground/screenshots/v2-mockup/import-dark.png differ diff --git a/playground/screenshots/v2-mockup/import-light.png b/playground/screenshots/v2-mockup/import-light.png new file mode 100644 index 0000000..c5a86d6 Binary files /dev/null and b/playground/screenshots/v2-mockup/import-light.png differ diff --git a/playground/screenshots/v2-mockup/overview-dark.png b/playground/screenshots/v2-mockup/overview-dark.png new file mode 100644 index 0000000..43835c3 Binary files /dev/null and b/playground/screenshots/v2-mockup/overview-dark.png differ diff --git a/playground/screenshots/v2-mockup/overview-light.png b/playground/screenshots/v2-mockup/overview-light.png new file mode 100644 index 0000000..3c85b04 Binary files /dev/null and b/playground/screenshots/v2-mockup/overview-light.png differ diff --git a/tests/screenshot/shoot-mockup.local.mjs b/tests/screenshot/shoot-mockup.local.mjs new file mode 100644 index 0000000..41a86a6 --- /dev/null +++ b/tests/screenshot/shoot-mockup.local.mjs @@ -0,0 +1,53 @@ +#!/usr/bin/env node +// Mockup verification screenshots — sesjon 2 (DS-hoist). +// Captures the 4 mockup states × 2 themes to confirm visual identity +// after hoisting project-view CSS to shared DS. +// +// Output: playground/screenshots/v2-mockup/-.png + +import { chromium } from 'playwright'; +import { fileURLToPath } from 'node:url'; +import { dirname, resolve, join } from 'node:path'; +import { mkdirSync, existsSync } from 'node:fs'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const PLUGIN_ROOT = resolve(__dirname, '..', '..'); +const HTML_PATH = join(PLUGIN_ROOT, 'playground', 'v2-mockup.local.html'); +const OUT_DIR = join(PLUGIN_ROOT, 'playground', 'screenshots', 'v2-mockup'); +const HTML_URL = 'file://' + HTML_PATH; + +const VIEWPORT = { width: 1440, height: 1200 }; +const STATES = ['overview', 'artifact', 'empty', 'import']; +const THEMES = ['dark', 'light']; + +if (!existsSync(OUT_DIR)) mkdirSync(OUT_DIR, { recursive: true }); + +const browser = await chromium.launch(); +const ctx = await browser.newContext({ viewport: VIEWPORT, deviceScaleFactor: 2 }); +const page = await ctx.newPage(); + +await page.goto(HTML_URL, { waitUntil: 'load' }); + +for (const theme of THEMES) { + await page.evaluate((t) => { + document.documentElement.setAttribute('data-theme', t); + const btns = document.querySelectorAll('[data-action="set-theme"]'); + btns.forEach((b) => b.setAttribute('aria-pressed', b.getAttribute('data-target') === t ? 'true' : 'false')); + }, theme); + await page.waitForTimeout(200); + + for (const state of STATES) { + await page.evaluate((s) => { + const btn = document.querySelector(`[data-action="set-state"][data-target="${s}"]`); + if (btn) btn.click(); + }, state); + await page.waitForTimeout(300); + const outPath = join(OUT_DIR, `${state}-${theme}.png`); + await page.screenshot({ path: outPath, fullPage: true }); + console.log(` → ${state}-${theme}.png`); + } +} + +await browser.close(); +console.log('\nDone. 8 screenshots → ' + OUT_DIR);