Files
progcode/docs/design-system/candidates/0340b0d273be/reviews/content-evidence/detail.js
T
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

3 lines
2.2 KiB
JavaScript
Raw 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:65019',out={};await page.setViewportSize({width:320,height:1000});for(const [id,slug,selector] of [['d','пишем-аналог-функции-php-preg_match_all-на-языке-прог','pre'],['ctfe','новый-движок-ctfe','table']]){await page.goto(base+'/articles/'+encodeURIComponent(slug)+'/');await page.getByLabel('Тема',{exact:true}).selectOption('dark');let target=page.locator(selector);if(id==='d'){let lengths=await target.evaluateAll(es=>es.map(e=>e.textContent.length));target=target.nth(lengths.indexOf(Math.max(...lengths)));}else target=target.first();await target.scrollIntoViewIfNeeded();const region=target.locator('xpath=..');out[id]=await region.evaluate(e=>({tag:e.tagName,cls:e.className,role:e.getAttribute('role'),tabIndex:e.tabIndex,client:e.clientWidth,scroll:e.scrollWidth,html:e.innerHTML.length,text:e.textContent.length,rows:e.querySelectorAll('tr').length,columns:e.querySelector('tr')?.children.length}));await region.focus();await page.keyboard.press('End');await page.keyboard.press('ArrowRight');await page.waitForTimeout(250);out[id].after=await region.evaluate(e=>({left:e.scrollLeft,focus:document.activeElement===e}));await page.screenshot({path:'/tmp/progcode-ds-content/'+id+'-320-dark-keyboard-right.png'});}
await page.goto(base+'/ui-kit/');out.specimens=await page.locator('.specimen-label').allTextContents();out.uikitText=await page.locator('main').innerText();await page.locator('table').first().scrollIntoViewIfNeeded();await page.screenshot({path:'/tmp/progcode-ds-content/uikit-320-dark-table.png'});await page.goto(base+'/articles/о-tilix-и-d-интервью-с-геральдом-нанном/');const details=page.locator('details');out.toc={count:await details.count(),initial:await details.getAttribute('open')};await details.locator('summary').click();out.toc.closed=await details.getAttribute('open');await details.locator('summary').click();const fifth=details.locator('a').nth(4);out.toc.href=await fifth.getAttribute('href');await fifth.click();out.toc.target=await page.evaluate(()=>({hash:location.hash,y:document.querySelector(location.hash)?.getBoundingClientRect().top}));await page.locator('main').evaluate(e=>e.scrollIntoView());return out;}