Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s

This commit is contained in:
huncode committed 2026-10-27 15:19:49 +03:00
1 parent 99c848189e
commit 12562baeb5
2040 files changed
+184656 -181

No files matched your search

@@ -0,0 +1,13 @@
async page=>{
const b='http://127.0.0.1:50480',o='/tmp/progcode-ds-designer-f5',r={identity:await page.request.get(b+'/build-identity.json').then(r=>r.json()),checks:[]};
const css=async()=>page.evaluate(()=>{const all=[];function walk(rules,scope=''){for(const x of rules){if(x.cssRules)walk(x.cssRules,scope+'|'+x.conditionText);else if(x.selectorText)all.push(scope+'|'+x.selectorText+'|'+x.style.cssText)}}for(const s of document.styleSheets)walk(s.cssRules);return all});
await page.goto('http://127.0.0.1:65019/');const oldCSS=await css();await page.goto(b+'/');const newCSS=await css();r.cssDelta={old:oldCSS.length,new:newCSS.length,added:newCSS.filter(x=>!oldCSS.includes(x)),removed:oldCSS.filter(x=>!newCSS.includes(x))};
const cases=[['home','/'],['resources','/resources/'],['json','/tools/'],['about','/about/'],['privacy','/privacy/'],['sources','/sources/'],['accessibility','/accessibility/'],['kit','/ui-kit/']];
for(const theme of ['light','dark']){await page.goto(b+'/');await page.getByRole('combobox',{name:'Тема'}).selectOption(theme);for(const width of [320,390,1440]){await page.setViewportSize({width,height:900});for(const [name,path] of cases){const resp=await page.goto(b+path);if(name==='home')await page.locator('.lead-visual img').evaluate(e=>e.decode());await page.screenshot({path:o+'/'+name+'-'+width+'-'+theme+'-top.png'});await page.locator('footer').scrollIntoViewIfNeeded();await page.screenshot({path:o+'/'+name+'-'+width+'-'+theme+'-footer.png'});r.checks.push({name,path,width,theme,status:resp.status(),...await page.evaluate(()=>({scroll:document.documentElement.scrollWidth,themeValue:document.documentElement.dataset.theme,footerLinks:[...document.querySelectorAll('footer a')].map(e=>({text:e.textContent,href:e.getAttribute('href')})),h1:document.querySelector('h1')?.textContent}))});}}}
await page.setViewportSize({width:1440,height:900});await page.goto(b+'/');await page.getByRole('combobox',{name:'Тема'}).selectOption('light');await page.locator('#search').scrollIntoViewIfNeeded();r.homeField=await page.locator('#search').evaluate(e=>({width:e.clientWidth,bounding:e.getBoundingClientRect().width}));await page.screenshot({path:o+'/home-field-1440.png'});await page.locator('#search').fill('Bitrix');r.positive=await page.locator('.journal-list .index-entry').count();await page.locator('#search').fill('нетсовпадений');r.zero=await page.locator('.search-status').innerText();await page.getByRole('button',{name:'Сбросить поиск',exact:true}).click();r.reset=await page.locator('#search').inputValue();await page.getByRole('combobox',{name:'Тема'}).selectOption('dark');await page.reload();r.persist=await page.getByRole('combobox',{name:'Тема'}).inputValue();await page.goto(b+'/ui-kit/');await page.locator('#search').scrollIntoViewIfNeeded();r.kitField=await page.locator('#search').boundingBox();await page.screenshot({path:o+'/kit-field-1440-dark.png'});
await page.goto(b+'/tools/');await page.locator('#json').fill('{bad');await page.getByRole('button',{name:'Форматировать',exact:true}).click();r.jsonError=await page.locator('#json-status').innerText();await page.screenshot({path:o+'/json-error-dark.png',fullPage:true});
await page.setViewportSize({width:390,height:900});await page.goto(b+'/category/dlang/');r.catalogDate=await page.locator('time').first().innerText();await page.screenshot({path:o+'/catalog-date-390-dark.png'});
await page.goto(b+'/articles/'+encodeURIComponent('dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол')+'/');const fig=page.locator('figure').first();await fig.scrollIntoViewIfNeeded();await fig.locator('img').evaluate(e=>e.decode());await page.screenshot({path:o+'/gc-figure-390-dark.png'});
await page.goto(b+'/accessibility/');await page.keyboard.press('Tab');r.skipFocus=await page.evaluate(()=>({text:document.activeElement.textContent,outline:getComputedStyle(document.activeElement).outlineStyle}));
return r;
}