2 lines
1013 B
JavaScript
2 lines
1013 B
JavaScript
async page=>{const url='http://127.0.0.1:57752/review/candidates/3c4c84a0be93/';await page.goto(url);await page.setViewportSize({width:390,height:1000});await page.locator('#theme').selectOption('dark');await page.reload();const persisted=await page.locator('#theme').inputValue();await page.locator('#theme').selectOption('system');await page.emulateMedia({colorScheme:'dark'});const dark=await page.evaluate(()=>({mode:document.documentElement.dataset.theme,bg:getComputedStyle(document.body).backgroundColor}));await page.emulateMedia({colorScheme:'light'});const light=await page.evaluate(()=>({mode:document.documentElement.dataset.theme,bg:getComputedStyle(document.body).backgroundColor}));await page.locator('#theme').focus();await page.keyboard.press('Home');await page.keyboard.press('ArrowDown');await page.keyboard.press('Enter');return{persisted,dark,light,keyboardValue:await page.locator('#theme').inputValue(),note:'Viewer-only functional checks. No firstpaintflash/perproductallstates claim.'};}
|