for(constlangof['zh','en'])for(constthemeof['dark','light']){awaitp.evaluate(async({lang,theme})=>{state.lang=lang;document.documentElement.dataset.theme=theme;awaitnavigate('dashboard')},{lang,theme});awaitp.waitForFunction(()=>document.querySelector('#current-frame-image')?.naturalWidth===1200);assert(awaitp.locator('#current-frame-preview').evaluate(e=>e.getBoundingClientRect().height)>=(width<=720?320:400));assert(awaitp.evaluate(()=>document.documentElement.scrollWidth<=innerWidth));awaitp.locator('#current-frame-preview').focus();constfullImage=p.waitForRequest(r=>newURL(r.url()).pathname==='/fixture-preview.svg'&&!newURL(r.url()).searchParams.has('thumbnail'));awaitp.keyboard.press('Enter');awaitfullImage;awaitp.locator('dialog.image-viewer[open]').waitFor();awaitp.waitForFunction(()=>document.querySelector('#original-image')?.naturalWidth===1200);assert((awaitp.locator('dialog.image-viewer').boundingBox()).width<=Math.min(width-(width<=600?16:24),1234)+1,'Viewer should fit the image rather than span the screen');assert.equal(awaitp.locator('.image-viewer-name').textContent(),(lang==='zh'?'当前显示内容':'Currently displayed content')+' #42');assert.equal(awaitp.locator('.image-viewer-actions button').count(),3);constsizing=p.locator('.image-viewer-actions button[aria-pressed]');awaitsizing.nth(1).click();assert(awaitp.locator('.image-viewer-viewport').evaluate(e=>e.classList.contains('actual-size')));awaitsizing.nth(0).click();assert(!awaitp.locator('.image-viewer-viewport').evaluate(e=>e.classList.contains('actual-size')));awaitp.keyboard.press('Escape');assert(!awaitp.locator('#modal').evaluate(e=>e.open));awaitp.waitForFunction(()=>!document.body.classList.contains('image-viewer-open'));if(process.env.FRAME_FLOW_SCREENSHOT_DIR&&lang==='zh'&&theme==='dark'){require('fs').mkdirSync(process.env.FRAME_FLOW_SCREENSHOT_DIR,{recursive:true});awaitp.screenshot({path:process.env.FRAME_FLOW_SCREENSHOT_DIR+'/dashboard-'+width+'.png',fullPage:true});}awaitp.evaluate(()=>navigate('gallery'));awaitp.locator('[data-original="0"]').click();awaitp.locator('dialog.image-viewer[open]').waitFor();assert.equal(awaitp.locator('.image-viewer-actions button').count(),3);awaitp.locator('#modal-cancel').click();checks++;}assert.deepEqual(errors,[]);awaitp.close();}console.log('Dashboard preview: '+checks+' profiles PASS; larger preview, keyboard opening, shared gallery viewer, fit/actual size, Escape, no overflow');}finally{awaitbrowser.close()}})().catch(e=>{console.error(e);process.exit(1)});