You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
525 B
11 lines
525 B
import { chromium } from 'playwright';
|
|
const [component, out] = process.argv.slice(2);
|
|
const b = await chromium.launch();
|
|
const p = await b.newPage({ viewport: { width: 1280, height: 900 }, deviceScaleFactor: 2 });
|
|
await p.goto(`http://localhost:5173/uix/components/${component}`, { waitUntil: 'networkidle' });
|
|
await p.waitForTimeout(900);
|
|
const stage = p.locator('[data-uix-stage]').first();
|
|
await ((await stage.count()) ? stage : p.locator('body')).screenshot({ path: out });
|
|
console.log('shot ->', out);
|
|
await b.close();
|