import fs from 'node:fs/promises'; import path from 'node:path'; import {fileURLToPath} from 'node:url'; import {chromium} from 'playwright'; const here=path.dirname(fileURLToPath(import.meta.url)); const browser=await chromium.launch({headless:true,channel:'chrome'}); try { const page=await browser.newPage({viewport:{width:1100,height:870},deviceScaleFactor:1}); for(const name of ['01-export','02-media','03-captions','invoice-01','invoice-02']){ await page.goto('file://'+path.join(here,name+'.html')); await page.screenshot({path:path.join(here,'../kit/candidate',name.startsWith('invoice')?'task-09':'task-06','inputs',name+'.png'),fullPage:true}); } }finally{await browser.close()}