Files
huncode 12562baeb5
Build and deploy / deploy (push) Successful in 2m39s
Implement ProgCode identity and real shared reading UI kit
2026-10-27 15:19:49 +03:00

2 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
async(page)=>{const base='http://127.0.0.1:55653',out={cases:[],errors:[],external:[]};page.on('pageerror',e=>out.errors.push(String(e)));page.on('request',r=>{if(!r.url().startsWith(base)&&!r.url().startsWith('data:'))out.external.push(r.url());});for(const [id,path,width,theme]of[['uikit','/ui-kit/',390,'dark'],['tilix','/articles/о-tilix-и-d-интервью-с-геральдом-нанном/',1440,'light'],['accessibility','/accessibility/',320,'dark'],['resources','/resources/',320,'light']]){await page.setViewportSize({width,height:1000});await page.emulateMedia({reducedMotion:'reduce',colorScheme:theme});const r=await page.goto(base+path,{waitUntil:'networkidle'});await page.getByLabel('Тема',{exact:true}).selectOption(theme);await page.evaluate(()=>document.fonts.ready);let data=await page.evaluate(()=>({width:innerWidth,scroll:document.documentElement.scrollWidth,h1:document.querySelector('h1').innerText,footer:document.querySelector('footer').innerText}));out.cases.push({id,path,width,theme,status:r.status(),...data});await page.screenshot({path:'/tmp/progcode-ds-cm-f6/'+id+'-'+width+'-'+theme+'-top.png'});if(id==='uikit'){await page.locator('.uikit-native').scrollIntoViewIfNeeded();await page.locator('.uikit-native img').evaluateAll(async es=>{await Promise.all(es.map(e=>e.decode()));});await page.screenshot({path:'/tmp/progcode-ds-cm-f6/uikit-native-390-dark.png'});}if(id==='accessibility'){await page.evaluate(()=>window.scrollTo({top:document.body.scrollHeight,behavior:'instant'}));await page.screenshot({path:'/tmp/progcode-ds-cm-f6/accessibility-footer-320-dark.png'});}}out.identity=await page.evaluate(async()=>await(await fetch('/build-identity.json')).json());return out;}