Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s
No files matched your search
@@ -0,0 +1,36 @@
|
||||
async page => {
|
||||
const context=page.context();const calls=[],external=[],violations=[],errors=[];
|
||||
await context.route('**/*',async route=>{const url=route.request().url();if(['https://progcode.ru/','https://www.progcode.ru/','http://progcode.ru/','https://progcode.ru.evil.test/'].some(origin=>url.startsWith(origin))){const r=await context.request.get(url.replace(/^https?:\/\/[^/]+/,'http://127.0.0.1:65019'));await route.fulfill({response:r});}else if(url==='https://mc.yandex.ru/metrika/tag.js'){external.push({url,action:'stub SDK'});await route.fulfill({contentType:'application/javascript',body:'const queued=window.ym.a||[];window.__ymCalls=[];window.ym=function(){window.__ymCalls.push(Array.from(arguments));};for(const args of queued)window.ym(...args);'});}else if(url.startsWith('http://127.0.0.1:65019/')) await route.continue();else{external.push({url,action:'aborted'});await route.abort();}});
|
||||
await context.addInitScript(()=>document.addEventListener('securitypolicyviolation',e=>(window.__cspViolations??=[]).push(e.violatedDirective)));
|
||||
page.on('pageerror',e=>errors.push(e.message));
|
||||
const read=()=>page.evaluate(()=>window.__ymCalls||[]);
|
||||
const count=(list,event)=>list.filter(x=>x[1]==='reachGoal'&&x[2]===event).length;
|
||||
const check=(condition,message)=>{if(!condition)throw Error(message);};
|
||||
await page.clock.install();await page.goto('http://127.0.0.1:65019/');await page.waitForTimeout(700);
|
||||
check(await page.evaluate(()=>!window.ym&&!document.querySelector('script[src*="mc.yandex"]')),'localhost loaded counter');
|
||||
calls.push({case:'localhost guard',passed:true});
|
||||
for(const host of ['http://progcode.ru/','https://progcode.ru.evil.test/']){await page.goto(host);await page.waitForTimeout(300);check(await page.evaluate(()=>!window.ym),'guard failure '+host);}
|
||||
await page.goto('https://www.progcode.ru/');await page.waitForFunction(()=>window.__ymCalls?.length>=2);calls.push({case:'HTTP and hostname suffix denied; www allowed',passed:true});
|
||||
for(const path of ['/about/','/контакты/','/resources/','/tools/','/privacy/','/sources/','/ui-kit/']){await page.goto('https://progcode.ru'+path);await page.waitForFunction(()=>window.__ymCalls?.length>=2);await page.evaluate(()=>scrollTo({top:document.body.scrollHeight,behavior:'instant'}));await page.clock.fastForward(61000);check(!count(await read(),'engaged_read'),'nonarticle read '+path);check(!count(await read(),'content_problem'),'inapplicable content problem '+path);}
|
||||
calls.push({case:'61s at bottom on seven nonarticle pages including all new service/demo pages: no article event or inapplicable diagnostic',passed:true});
|
||||
await page.goto('https://progcode.ru/');await page.waitForFunction(()=>window.__ymCalls?.length>=2);
|
||||
let list=await read();check(list.filter(x=>x[1]==='init').length===1,'duplicate init');check(list.filter(x=>x[1]==='hit').length===1,'initial hit');check(!count(list,'engaged_read')&&!count(list,'search_zero_results'),'initial goals');
|
||||
await page.locator('#search').fill('private@example.test');await page.waitForTimeout(650);list=await read();check(count(list,'search_zero_results')===1,'zero result event missing');check(!JSON.stringify(list).includes('private@example.test'),'query leaked');
|
||||
await page.locator('#search').fill('мусорщика');await page.locator('.journal-list a').first().click();await page.waitForSelector('.article-content');await page.waitForTimeout(300);list=await read();check(count(list,'search_used')===1,'selection search event missing');check(list.filter(x=>x[1]==='hit').length===2,'SPA hit missing/duplicate');check(list.filter(x=>x[1]==='init').length===1,'SPA reinit');
|
||||
calls.push({case:'initial / search privacy / client navigation',passed:true,calls:list});
|
||||
await page.bringToFront();await page.evaluate(()=>scrollTo({top:0,behavior:'instant'}));await page.clock.fastForward(61000);check(!count(await read(),'engaged_read'),'read without depth');
|
||||
await page.evaluate(()=>document.querySelector('.article-content').scrollIntoView({block:'end',behavior:'instant'}));await page.clock.fastForward(1000);check(count(await read(),'engaged_read')===1,'qualified read missing');await page.clock.fastForward(61000);check(count(await read(),'engaged_read')===1,'read repeated');
|
||||
calls.push({case:'61 seconds without depth; depth then once',passed:true});
|
||||
const related=page.locator('.related a').first();await related.waitFor({timeout:5000});await related.click();await page.waitForTimeout(300);check(count(await read(),'related_content_click')===1,'related event missing');
|
||||
await page.evaluate(()=>document.querySelector('.article-content').scrollIntoView({block:'end',behavior:'instant'}));await page.clock.fastForward(30000);
|
||||
await page.evaluate(()=>{Object.defineProperty(document,'hasFocus',{value:()=>false,configurable:true});Object.defineProperty(document,'visibilityState',{value:'hidden',configurable:true});dispatchEvent(new Event('blur'));document.dispatchEvent(new Event('visibilitychange'));});await page.clock.fastForward(61000);check(count(await read(),'engaged_read')===1,'unfocused time counted');await page.evaluate(()=>{delete document.hasFocus;delete document.visibilityState;dispatchEvent(new Event('focus'));document.dispatchEvent(new Event('visibilitychange'));});await page.clock.fastForward(28000);check(count(await read(),'engaged_read')===1,'focus resumed too early');await page.clock.fastForward(3000);check(count(await read(),'engaged_read')===2,'focused total not counted');
|
||||
calls.push({case:'related navigation and excluded 61s simulated hidden/unfocused state',passed:true});
|
||||
const beforeHash=await read();await page.evaluate(()=>{location.hash='main';});await page.clock.fastForward(1000);check((await read()).filter(x=>x[1]==='hit').length===beforeHash.filter(x=>x[1]==='hit').length,'hash fabricated hit');
|
||||
await page.evaluate(()=>{location.hash='nonexistent-private-fragment';});await page.clock.fastForward(1000);check((await read()).some(x=>x[2]==='content_problem'&&x[3]?.reason==='fragment_missing'),'missing fragment missing');
|
||||
const img=page.locator('.article-content img').first();if(await img.count()){await img.evaluate(el=>{el.src='/broken-test-image.jpg';el.loading='eager';});await page.waitForTimeout(300);check((await read()).some(x=>x[2]==='content_problem'&&x[3]?.reason==='image_failed'),'failed image event missing');}
|
||||
calls.push({case:'fragment / failed real content image',passed:true,imagePresent:!!(await img.count()),calls:await read()});
|
||||
const beforeNav=await read();await page.locator('.masthead a[href="/resources/"]').click();await page.waitForTimeout(300);const afterNav=await read();check(afterNav.filter(x=>x[1]==='hit').length===beforeNav.filter(x=>x[1]==='hit').length+1,'ordinary navigation hit');check(afterNav.filter(x=>x[1]==='reachGoal').length===beforeNav.filter(x=>x[1]==='reachGoal').length,'ordinary navigation goal');check(!count(afterNav,'download_click'),'download fabricated');calls.push({case:'existing hash no extra hit; ordinary navigation no recommendation/download goal',passed:true});
|
||||
await page.goto('https://progcode.ru/unknown-private-path/');await page.waitForFunction(()=>window.__ymCalls?.some(x=>x[2]==='content_problem'&&x[3]?.reason==='not_found'));list=await read();check(!JSON.stringify(list).includes('unknown-private-path'),'unknown URL leaked in calls');check(!list.some(x=>x[1]==='notBounce'),'forced bounce');
|
||||
calls.push({case:'confirmed 404 and missing fragment; unavailable downloads stay silent',passed:true,calls:list});
|
||||
return {cases:calls,external,errors,cspViolations:await page.evaluate(()=>window.__cspViolations||[]),statisticsSent:0};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"cases":[{"case":"localhost guard","passed":true},{"case":"HTTP and hostname suffix denied; www allowed","passed":true},{"case":"61s at bottom on seven nonarticle pages including all new service/demo pages: no article event or inapplicable diagnostic","passed":true},{"case":"initial / search privacy / client navigation","passed":true,"calls":[[109268613,"init",{"defer":true,"clickmap":true,"trackLinks":true,"accurateTrackBounce":true,"webvisor":false,"trackHash":false}],[109268613,"hit","https://progcode.ru/",{"title":"ProgCode — записки о программировании","referer":""}],[109268613,"reachGoal","search_zero_results"],[109268613,"reachGoal","search_used"],[109268613,"hit","https://progcode.ru/articles/dconf-2017-%D0%BF%D0%BE%D0%B4-%D0%BA%D0%B0%D0%BF%D0%BE%D1%82%D0%BE%D0%BC-%D0%BC%D1%83%D1%81%D0%BE%D1%80%D1%89%D0%B8%D0%BA%D0%B0-%D0%B4%D0%B8-%D0%B4%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9-%D0%BE%D0%BB/",{"title":"DConf-2017. Под капотом мусорщика D (Дмитрий Ольшанский) — ProgCode","referer":"https://progcode.ru/"}]]},{"case":"61 seconds without depth; depth then once","passed":true},{"case":"related navigation and excluded 61s simulated hidden/unfocused state","passed":true},{"case":"fragment / failed real content image","passed":true,"imagePresent":true,"calls":[[109268613,"init",{"defer":true,"clickmap":true,"trackLinks":true,"accurateTrackBounce":true,"webvisor":false,"trackHash":false}],[109268613,"hit","https://progcode.ru/",{"title":"ProgCode — записки о программировании","referer":""}],[109268613,"reachGoal","search_zero_results"],[109268613,"reachGoal","search_used"],[109268613,"hit","https://progcode.ru/articles/dconf-2017-%D0%BF%D0%BE%D0%B4-%D0%BA%D0%B0%D0%BF%D0%BE%D1%82%D0%BE%D0%BC-%D0%BC%D1%83%D1%81%D0%BE%D1%80%D1%89%D0%B8%D0%BA%D0%B0-%D0%B4%D0%B8-%D0%B4%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9-%D0%BE%D0%BB/",{"title":"DConf-2017. Под капотом мусорщика D (Дмитрий Ольшанский) — ProgCode","referer":"https://progcode.ru/"}],[109268613,"reachGoal","engaged_read"],[109268613,"reachGoal","related_content_click"],[109268613,"hit","https://progcode.ru/articles/%D0%BE-tilix-%D0%B8-d-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B2%D1%8C%D1%8E-%D1%81-%D0%B3%D0%B5%D1%80%D0%B0%D0%BB%D1%8C%D0%B4%D0%BE%D0%BC-%D0%BD%D0%B0%D0%BD%D0%BD%D0%BE%D0%BC/",{"title":"О Tilix и D: интервью с Геральдом Нанном — ProgCode","referer":"https://progcode.ru/articles/dconf-2017-%D0%BF%D0%BE%D0%B4-%D0%BA%D0%B0%D0%BF%D0%BE%D1%82%D0%BE%D0%BC-%D0%BC%D1%83%D1%81%D0%BE%D1%80%D1%89%D0%B8%D0%BA%D0%B0-%D0%B4%D0%B8-%D0%B4%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9-%D0%BE%D0%BB/"}],[109268613,"reachGoal","engaged_read"],[109268613,"reachGoal","content_problem",{"reason":"fragment_missing"}],[109268613,"reachGoal","content_problem",{"reason":"image_failed"}]]},{"case":"existing hash no extra hit; ordinary navigation no recommendation/download goal","passed":true},{"case":"confirmed 404 and missing fragment; unavailable downloads stay silent","passed":true,"calls":[[109268613,"init",{"defer":true,"clickmap":true,"trackLinks":true,"accurateTrackBounce":true,"webvisor":false,"trackHash":false}],[109268613,"hit","https://progcode.ru/404/",{"title":"ProgCode — записки о программировании","referer":""}],[109268613,"reachGoal","content_problem",{"reason":"not_found"}]]}],"external":[{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"},{"url":"https://mc.yandex.ru/metrika/tag.js","action":"stub SDK"}],"errors":[],"cspViolations":[],"statisticsSent":0}
|
||||
@@ -0,0 +1,49 @@
|
||||
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
||||
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
||||
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
|
||||
|
||||
> progcode@1.0.0 build
|
||||
> node scripts/check-dates.mjs && node scripts/prepare-publication.mjs && next build
|
||||
|
||||
{"historicalCalendar":"UTC","fixtures":3,"hostTimezones":["UTC","Europe/Moscow"],"passed":true}
|
||||
{"sourceHash":"0340b0d273bedcdca081ed2077bcb6959738fef0275737d4990271a3eddc0e3c","articles":14,"hostileFixturePassed":true}
|
||||
▲ Next.js 16.2.6 (Turbopack)
|
||||
- Experiments (use with caution):
|
||||
· cpus: 2
|
||||
|
||||
Creating an optimized production build ...
|
||||
✓ Compiled successfully in 1049ms
|
||||
Running TypeScript ...
|
||||
Finished TypeScript in 45ms ...
|
||||
Collecting page data using 2 workers ...
|
||||
Generating static pages using 2 workers (0/83) ...
|
||||
Generating static pages using 2 workers (20/83)
|
||||
Generating static pages using 2 workers (41/83)
|
||||
Generating static pages using 2 workers (62/83)
|
||||
✓ Generating static pages using 2 workers (83/83) in 260ms
|
||||
Finalizing page optimization ...
|
||||
|
||||
Route (app)
|
||||
┌ ○ /
|
||||
├ ○ /_not-found
|
||||
├ ● /[...path]
|
||||
│ ├ /2019/01/12/использование-jquery-в-webpack
|
||||
│ ├ /2018/10/19/bitrix-api-add-foto-editor
|
||||
│ ├ /2017/08/25/о-tilix-и-d-интервью-с-геральдом-нанном
|
||||
│ └ [+57 more paths]
|
||||
├ ○ /about
|
||||
├ ● /articles/[slug]
|
||||
│ ├ /articles/использование-jquery-в-webpack
|
||||
│ ├ /articles/bitrix-api-add-foto-editor
|
||||
│ ├ /articles/о-tilix-и-d-интервью-с-геральдом-нанном
|
||||
│ └ [+11 more paths]
|
||||
├ ○ /privacy
|
||||
├ ○ /resources
|
||||
├ ○ /sources
|
||||
├ ○ /tools
|
||||
└ ○ /ui-kit
|
||||
|
||||
|
||||
○ (Static) prerendered as static content
|
||||
● (SSG) prerendered as static HTML (uses generateStaticParams)
|
||||
|
||||
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 84 KiB |
@@ -0,0 +1,10 @@
|
||||
async page=>{
|
||||
const b='http://127.0.0.1:65019',o='/tmp/progcode-ds-designer0340',r={};await page.setViewportSize({width:390,height:900});await page.goto(b+'/');await page.getByRole('combobox',{name:'Тема'}).selectOption('light');await page.locator('#search').fill('Bitrix');r.search=await page.locator('.journal-list .index-entry').count();await page.locator('#search').fill('неттакойтемы');r.zero=await page.locator('.search-status').innerText();await page.locator('#journal').scrollIntoViewIfNeeded();await page.screenshot({path:o+'/search-zero-light.png'});await page.getByRole('button',{name:'Сбросить поиск',exact:true}).click();r.reset=await page.locator('#search').inputValue();await page.getByRole('button',{name:'D',exact:true}).click();r.topicD=await page.locator('.journal-list .index-entry').count();await page.getByRole('combobox',{name:'Тема'}).selectOption('dark');await page.reload();r.persist=await page.getByRole('combobox',{name:'Тема'}).inputValue();
|
||||
for(const theme of ['light','dark']){await page.getByRole('combobox',{name:'Тема'}).selectOption(theme);await page.goto(b+'/tools/');await page.locator('#json').fill('{bad');await page.getByRole('button',{name:'Форматировать',exact:true}).click();r['error'+theme]=await page.locator('#json-status').innerText();await page.screenshot({path:o+'/json-error-'+theme+'.png',fullPage:true});await page.locator('#json').fill('{"ok":true}');await page.getByRole('button',{name:'Форматировать',exact:true}).click();await page.getByRole('button',{name:'Копировать',exact:true}).click();await page.waitForTimeout(300);r['copy'+theme]=await page.locator('.copy-feedback').innerText();}
|
||||
await page.goto(b+'/articles/'+encodeURIComponent('новый-движок-ctfe')+'/');const table=page.locator('.table-scroll').first();await table.scrollIntoViewIfNeeded();await table.focus();for(let i=0;i<20;i++)await page.keyboard.press('ArrowRight');await page.waitForTimeout(300);r.table=await table.evaluate(e=>({left:e.scrollLeft,max:e.scrollWidth-e.clientWidth,body:document.documentElement.scrollWidth,focus:document.activeElement===e,outline:getComputedStyle(e).outlineStyle}));await page.screenshot({path:o+'/table-right-dark.png'});
|
||||
await page.goto(b+'/articles/'+encodeURIComponent('пишем-аналог-функции-php-preg_match_all-на-языке-прог')+'/');const code=page.locator('pre').nth(1);await code.scrollIntoViewIfNeeded();await code.focus();for(let i=0;i<20;i++)await page.keyboard.press('ArrowRight');await page.waitForTimeout(300);r.code=await code.evaluate(e=>({left:e.scrollLeft,max:e.scrollWidth-e.clientWidth,body:document.documentElement.scrollWidth,focus:document.activeElement===e,outline:getComputedStyle(e).outlineStyle}));await page.screenshot({path:o+'/code-right-dark.png'});
|
||||
for(const [name,slug] of [['gc','dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол'],['ctfe','новый-движок-ctfe'],['vibe','особенности-vibe-d'],['bitrix','bitrix-api-add-foto-editor']]){await page.goto(b+'/articles/'+encodeURIComponent(slug)+'/');let i=0;for(const fig of await page.locator('figure').all()){await fig.scrollIntoViewIfNeeded();for(const img of await fig.locator('img').all()){await img.evaluate(e=>e.decode());}await page.screenshot({path:o+'/'+name+'-390-dark-decoded'+i+++'.png'});}}
|
||||
await page.setViewportSize({width:1440,height:900});await page.goto(b+'/articles/'+encodeURIComponent('о-tilix-и-d-интервью-с-геральдом-нанном')+'/');r.lines=await page.evaluate(()=>{const result=[];for(const p of [...document.querySelectorAll('.article-content p')].filter(p=>p.textContent.length>180).slice(0,7)){const tw=document.createTreeWalker(p,NodeFilter.SHOW_TEXT);let node;const lines=new Map();while(node=tw.nextNode()){for(let i=0;i<node.length;i++){const range=document.createRange();range.setStart(node,i);range.setEnd(node,i+1);const box=range.getBoundingClientRect();if(!box.width)continue;const y=Math.round(box.top);lines.set(y,(lines.get(y)||0)+1);}}result.push({length:p.textContent.length,lines:[...lines.values()],width:p.clientWidth,font:getComputedStyle(p).fontSize,lineHeight:getComputedStyle(p).lineHeight});}return result;});
|
||||
r.zoomBefore=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Control+Equal');await page.keyboard.press('Control+Equal');await page.keyboard.press('Control+Equal');await page.waitForTimeout(300);r.zoomAfterControl=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Control+0');await page.keyboard.press('Meta+Equal');await page.keyboard.press('Meta+Equal');await page.keyboard.press('Meta+Equal');await page.waitForTimeout(300);r.zoomAfterMeta=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Meta+0');
|
||||
return r;
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"search": 3,
|
||||
"zero": "По этому запросу ничего нет. Попробуйте другое слово или сбросьте тему.",
|
||||
"reset": "",
|
||||
"topicD": 6,
|
||||
"persist": "dark",
|
||||
"errorlight": "Ошибка синтаксиса: Expected property name or '}' in JSON at position 1 (line 1 column 2)",
|
||||
"copylight": "Скопировано",
|
||||
"errordark": "Ошибка синтаксиса: Expected property name or '}' in JSON at position 1 (line 1 column 2)",
|
||||
"copydark": "Скопировано",
|
||||
"table": {
|
||||
"left": 264,
|
||||
"max": 264,
|
||||
"body": 390,
|
||||
"focus": true,
|
||||
"outline": "solid"
|
||||
},
|
||||
"code": {
|
||||
"left": 379,
|
||||
"max": 379,
|
||||
"body": 390,
|
||||
"focus": true,
|
||||
"outline": "solid"
|
||||
},
|
||||
"lines": [
|
||||
{
|
||||
"length": 269,
|
||||
"lines": [
|
||||
75,
|
||||
64,
|
||||
77,
|
||||
50
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 531,
|
||||
"lines": [
|
||||
71,
|
||||
70,
|
||||
68,
|
||||
77,
|
||||
73,
|
||||
71,
|
||||
60,
|
||||
32
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 383,
|
||||
"lines": [
|
||||
73,
|
||||
74,
|
||||
67,
|
||||
74,
|
||||
67,
|
||||
23
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 578,
|
||||
"lines": [
|
||||
77,
|
||||
71,
|
||||
74,
|
||||
68,
|
||||
72,
|
||||
77,
|
||||
70,
|
||||
62
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 334,
|
||||
"lines": [
|
||||
76,
|
||||
72,
|
||||
66,
|
||||
67,
|
||||
49
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 717,
|
||||
"lines": [
|
||||
72,
|
||||
67,
|
||||
72,
|
||||
74,
|
||||
73,
|
||||
67,
|
||||
74,
|
||||
77,
|
||||
71,
|
||||
61
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
},
|
||||
{
|
||||
"length": 393,
|
||||
"lines": [
|
||||
74,
|
||||
80,
|
||||
67,
|
||||
80,
|
||||
73,
|
||||
14
|
||||
],
|
||||
"width": 740,
|
||||
"font": "19px",
|
||||
"lineHeight": "32.68px"
|
||||
}
|
||||
],
|
||||
"zoomBefore": {
|
||||
"inner": 1440,
|
||||
"ratio": 1
|
||||
},
|
||||
"zoomAfterControl": {
|
||||
"inner": 1440,
|
||||
"ratio": 1
|
||||
},
|
||||
"zoomAfterMeta": {
|
||||
"inner": 1440,
|
||||
"ratio": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
### Result
|
||||
{"search":3,"zero":"По этому запросу ничего нет. Попробуйте другое слово или сбросьте тему.","reset":"","topicD":6,"persist":"dark","errorlight":"Ошибка синтаксиса: Expected property name or '}' in JSON at position 1 (line 1 column 2)","copylight":"Скопировано","errordark":"Ошибка синтаксиса: Expected property name or '}' in JSON at position 1 (line 1 column 2)","copydark":"Скопировано","table":{"left":264,"max":264,"body":390,"focus":true,"outline":"solid"},"code":{"left":379,"max":379,"body":390,"focus":true,"outline":"solid"},"lines":[{"length":269,"lines":[75,64,77,50],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":531,"lines":[71,70,68,77,73,71,60,32],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":383,"lines":[73,74,67,74,67,23],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":578,"lines":[77,71,74,68,72,77,70,62],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":334,"lines":[76,72,66,67,49],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":717,"lines":[72,67,72,74,73,67,74,77,71,61],"width":740,"font":"19px","lineHeight":"32.68px"},{"length":393,"lines":[74,80,67,80,73,14],"width":740,"font":"19px","lineHeight":"32.68px"}],"zoomBefore":{"inner":1440,"ratio":1},"zoomAfterControl":{"inner":1440,"ratio":1},"zoomAfterMeta":{"inner":1440,"ratio":1}}
|
||||
### Ran Playwright code
|
||||
```js
|
||||
await (async page=>{
|
||||
const b='http://127.0.0.1:65019',o='/tmp/progcode-ds-designer0340',r={};await page.setViewportSize({width:390,height:900});await page.goto(b+'/');await page.getByRole('combobox',{name:'Тема'}).selectOption('light');await page.locator('#search').fill('Bitrix');r.search=await page.locator('.journal-list .index-entry').count();await page.locator('#search').fill('неттакойтемы');r.zero=await page.locator('.search-status').innerText();await page.locator('#journal').scrollIntoViewIfNeeded();await page.screenshot({path:o+'/search-zero-light.png'});await page.getByRole('button',{name:'Сбросить поиск',exact:true}).click();r.reset=await page.locator('#search').inputValue();await page.getByRole('button',{name:'D',exact:true}).click();r.topicD=await page.locator('.journal-list .index-entry').count();await page.getByRole('combobox',{name:'Тема'}).selectOption('dark');await page.reload();r.persist=await page.getByRole('combobox',{name:'Тема'}).inputValue();
|
||||
for(const theme of ['light','dark']){await page.getByRole('combobox',{name:'Тема'}).selectOption(theme);await page.goto(b+'/tools/');await page.locator('#json').fill('{bad');await page.getByRole('button',{name:'Форматировать',exact:true}).click();r['error'+theme]=await page.locator('#json-status').innerText();await page.screenshot({path:o+'/json-error-'+theme+'.png',fullPage:true});await page.locator('#json').fill('{"ok":true}');await page.getByRole('button',{name:'Форматировать',exact:true}).click();await page.getByRole('button',{name:'Копировать',exact:true}).click();await page.waitForTimeout(300);r['copy'+theme]=await page.locator('.copy-feedback').innerText();}
|
||||
await page.goto(b+'/articles/'+encodeURIComponent('новый-движок-ctfe')+'/');const table=page.locator('.table-scroll').first();await table.scrollIntoViewIfNeeded();await table.focus();for(let i=0;i<20;i++)await page.keyboard.press('ArrowRight');await page.waitForTimeout(300);r.table=await table.evaluate(e=>({left:e.scrollLeft,max:e.scrollWidth-e.clientWidth,body:document.documentElement.scrollWidth,focus:document.activeElement===e,outline:getComputedStyle(e).outlineStyle}));await page.screenshot({path:o+'/table-right-dark.png'});
|
||||
await page.goto(b+'/articles/'+encodeURIComponent('пишем-аналог-функции-php-preg_match_all-на-языке-прог')+'/');const code=page.locator('pre').nth(1);await code.scrollIntoViewIfNeeded();await code.focus();for(let i=0;i<20;i++)await page.keyboard.press('ArrowRight');await page.waitForTimeout(300);r.code=await code.evaluate(e=>({left:e.scrollLeft,max:e.scrollWidth-e.clientWidth,body:document.documentElement.scrollWidth,focus:document.activeElement===e,outline:getComputedStyle(e).outlineStyle}));await page.screenshot({path:o+'/code-right-dark.png'});
|
||||
for(const [name,slug] of [['gc','dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол'],['ctfe','новый-движок-ctfe'],['vibe','особенности-vibe-d'],['bitrix','bitrix-api-add-foto-editor']]){await page.goto(b+'/articles/'+encodeURIComponent(slug)+'/');let i=0;for(const fig of await page.locator('figure').all()){await fig.scrollIntoViewIfNeeded();for(const img of await fig.locator('img').all()){await img.evaluate(e=>e.decode());}await page.screenshot({path:o+'/'+name+'-390-dark-decoded'+i+++'.png'});}}
|
||||
await page.setViewportSize({width:1440,height:900});await page.goto(b+'/articles/'+encodeURIComponent('о-tilix-и-d-интервью-с-геральдом-нанном')+'/');r.lines=await page.evaluate(()=>{const result=[];for(const p of [...document.querySelectorAll('.article-content p')].filter(p=>p.textContent.length>180).slice(0,7)){const tw=document.createTreeWalker(p,NodeFilter.SHOW_TEXT);let node;const lines=new Map();while(node=tw.nextNode()){for(let i=0;i<node.length;i++){const range=document.createRange();range.setStart(node,i);range.setEnd(node,i+1);const box=range.getBoundingClientRect();if(!box.width)continue;const y=Math.round(box.top);lines.set(y,(lines.get(y)||0)+1);}}result.push({length:p.textContent.length,lines:[...lines.values()],width:p.clientWidth,font:getComputedStyle(p).fontSize,lineHeight:getComputedStyle(p).lineHeight});}return result;});
|
||||
r.zoomBefore=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Control+Equal');await page.keyboard.press('Control+Equal');await page.keyboard.press('Control+Equal');await page.waitForTimeout(300);r.zoomAfterControl=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Control+0');await page.keyboard.press('Meta+Equal');await page.keyboard.press('Meta+Equal');await page.keyboard.press('Meta+Equal');await page.waitForTimeout(300);r.zoomAfterMeta=await page.evaluate(()=>({inner:innerWidth,ratio:devicePixelRatio}));await page.keyboard.press('Meta+0');
|
||||
return r;
|
||||
}
|
||||
)(page);
|
||||
```
|
||||
### Page
|
||||
- Page URL: http://127.0.0.1:65019/articles/%D0%BE-tilix-%D0%B8-d-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B2%D1%8C%D1%8E-%D1%81-%D0%B3%D0%B5%D1%80%D0%B0%D0%BB%D1%8C%D0%B4%D0%BE%D0%BC-%D0%BD%D0%B0%D0%BD%D0%BD%D0%BE%D0%BC/
|
||||
- Page Title: О Tilix и D: интервью с Геральдом Нанном — ProgCode
|
||||
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 459 KiB |
@@ -0,0 +1,6 @@
|
||||
### Result
|
||||
{"x":144,"y":470.53125,"width":192,"height":51.59375}
|
||||
### Ran Playwright code
|
||||
```js
|
||||
await (async page=>{await page.locator('#search').scrollIntoViewIfNeeded();await page.screenshot({path:'/tmp/progcode-ds-designer0340/search-desktop-field.png'});return await page.locator('#search').boundingBox();})(page);
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
async page=>{await page.setViewportSize({width:1440,height:900});await page.goto('http://127.0.0.1:65019/');await page.getByRole('combobox',{name:'Тема'}).selectOption('light');await page.locator('#journal').scrollIntoViewIfNeeded();await page.screenshot({path:'/tmp/progcode-ds-designer0340/search-desktop-field.png'});return await page.locator('#search').evaluate(e=>({inputWidth:e.getBoundingClientRect().width,wrapperWidth:e.parentElement.getBoundingClientRect().width,controlWidth:e.closest('.catalog-controls').clientWidth}));}
|
||||
@@ -0,0 +1,10 @@
|
||||
### Result
|
||||
{"inputWidth":192,"wrapperWidth":192,"controlWidth":1200}
|
||||
### Ran Playwright code
|
||||
```js
|
||||
await (async page=>{await page.setViewportSize({width:1440,height:900});await page.goto('http://127.0.0.1:65019/');await page.getByRole('combobox',{name:'Тема'}).selectOption('light');await page.locator('#journal').scrollIntoViewIfNeeded();await page.screenshot({path:'/tmp/progcode-ds-designer0340/search-desktop-field.png'});return await page.locator('#search').evaluate(e=>({inputWidth:e.getBoundingClientRect().width,wrapperWidth:e.parentElement.getBoundingClientRect().width,controlWidth:e.closest('.catalog-controls').clientWidth}));}
|
||||
)(page);
|
||||
```
|
||||
### Page
|
||||
- Page URL: http://127.0.0.1:65019/
|
||||
- Page Title: ProgCode — записки о программировании
|
||||
@@ -0,0 +1 @@
|
||||
async page=>{await page.setViewportSize({width:390,height:900});await page.goto('http://127.0.0.1:65019/');await page.getByRole('combobox',{name:'Тема'}).selectOption('dark');await page.screenshot({path:'/tmp/progcode-ds-designer0340/dark-home-first.png',fullPage:true});const d=await page.locator('.lead-story h2').evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(e.closest('.lead-story')).backgroundColor}));await page.goto('http://127.0.0.1:65019/articles/'+encodeURIComponent('о-tilix-и-d-интервью-с-геральдом-нанном')+'/');await page.screenshot({path:'/tmp/progcode-ds-designer0340/dark-article-first.png'});return {lead:d,deck:await page.locator('.article-deck').evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(document.body).backgroundColor})),link:await page.locator('.article-content a').first().evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(document.body).backgroundColor}))};}
|
||||
@@ -0,0 +1,10 @@
|
||||
### Result
|
||||
{"lead":{"color":"rgb(238, 238, 229)","bg":"rgb(44, 52, 46)"},"deck":{"color":"rgb(178, 185, 174)","bg":"rgb(28, 33, 30)"},"link":{"color":"rgb(241, 161, 125)","bg":"rgb(28, 33, 30)"}}
|
||||
### Ran Playwright code
|
||||
```js
|
||||
await (async page=>{await page.setViewportSize({width:390,height:900});await page.goto('http://127.0.0.1:65019/');await page.getByRole('combobox',{name:'Тема'}).selectOption('dark');await page.screenshot({path:'/tmp/progcode-ds-designer0340/dark-home-first.png',fullPage:true});const d=await page.locator('.lead-story h2').evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(e.closest('.lead-story')).backgroundColor}));await page.goto('http://127.0.0.1:65019/articles/'+encodeURIComponent('о-tilix-и-d-интервью-с-геральдом-нанном')+'/');await page.screenshot({path:'/tmp/progcode-ds-designer0340/dark-article-first.png'});return {lead:d,deck:await page.locator('.article-deck').evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(document.body).backgroundColor})),link:await page.locator('.article-content a').first().evaluate(e=>({color:getComputedStyle(e).color,bg:getComputedStyle(document.body).backgroundColor}))};}
|
||||
)(page);
|
||||
```
|
||||
### Page
|
||||
- Page URL: http://127.0.0.1:65019/articles/%D0%BE-tilix-%D0%B8-d-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B2%D1%8C%D1%8E-%D1%81-%D0%B3%D0%B5%D1%80%D0%B0%D0%BB%D1%8C%D0%B4%D0%BE%D0%BC-%D0%BD%D0%B0%D0%BD%D0%BD%D0%BE%D0%BC/
|
||||
- Page Title: О Tilix и D: интервью с Геральдом Нанном — ProgCode
|
||||
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 37 KiB |