gitoria
All repositories: gitoria
23.6 KB
import { requiredPort } from './gate-ports.mjs';// W60: one own plain tab in the existing Chrome, real clicks and keys, own test storage.// Usage: TMPDIR=<scratch>/tmp HL_CDP_URL=http://127.0.0.1:9223 node tests/cleanup-browser.mjs <old app> <output root>import { spawn, execFileSync } from 'node:child_process';import { createServer } from 'node:http';import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';import { resolve, join } from 'node:path';import { launchBrowser } from './cdp.mjs';import { startIdent } from './identkit.mjs';const PORT = requiredPort('GITORIA_CLEANUP_PORT'), IPORT = requiredPort('GITORIA_CLEANUP_IDENT_PORT'), TPORT = requiredPort('GITORIA_CLEANUP_TICKETS_PORT');const CLIENT = process.argv[2] === '--client';const OUT = resolve(process.argv[3]), CURRENT = resolve('.'), OLD = CLIENT ? null : resolve(process.argv[2]);const CONFIG = CLIENT ? JSON.parse(readFileSync(join(OUT,'client-config.json'),'utf8')) : null;const J = JSON.stringify, sleep = ms => new Promise(r => setTimeout(r, ms));let passed = 0, failed = 0, browser, page, ident, server, fixture;const pids = [], shots = [];function check(name, ok) { console.log(`${ok ? 'ok' : 'FAIL'} ${name}`); ok ? passed++ : failed++; }function track(name, p) { pids.push({name,pid:p.pid}); console.log('PROCESS', name, p.pid); return p; }async function stop(p) { if (!p || p.exitCode !== null || p.signalCode !== null) return; p.kill('SIGTERM'); await Promise.race([new Promise(r=>p.once('exit',r)),sleep(3000)]); }async function up(url) { for (const end = Date.now()+240000; Date.now()<end;) { try { if ((await fetch(url)).ok) return; } catch {} await sleep(250); } throw new Error('server did not start '+url); }async function go(url, ready) { await page.goto(url); await page.waitForSelector(ready,{timeout:30000}); await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1',{timeout:30000}); }async function shot(tag,name,width) {console.log('SHOT',tag,name,width);const sels={repositories:'#createform',org:'#orgform',tokens:'#tokenform',keys:'#keyform',settings:'#memberform',app:'#appform',tickets:'#newticketform',pr:'#commentform',drafts:'#threadlist form'};const sel=sels[name];await page.evaluate(`document.activeElement?.blur();${sel?`document.querySelector(${J(sel)}).scrollIntoView({block:'center'});`:''}window.scrollX`);await sleep(150);const path=join(OUT,`${tag}-${name}-${width}.png`);let data;const errors=[];for(const attempt of [1,2]){try{({data}=await page.send('Page.captureScreenshot',{format:'png',captureBeyondViewport:false,fromSurface:false}));break;}catch(e){errors.push(e.message);console.log('SCREENSHOT TIMEOUT',tag,name,width,'attempt',attempt);if(attempt===1){console.log('RETRY SCREENSHOT ONCE',tag,name,width);await sleep(250);}}}if(errors.length)writeFileSync(path.replace('.png','-capture-attempts.json'),J({name,width,errors,succeeded:!!data}));if(!data){failed++;console.log('FAIL screenshot after one retry',tag,name,width);return;}writeFileSync(path,Buffer.from(data,'base64'));shots.push(path);const timeRects=await page.evaluate(`(()=>{const out=[];const walk=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT);while(walk.nextNode()){const n=walk.currentNode;if(!/20[0-9]{2}-[0-9]{2}-[0-9]{2}/.test(n.textContent)||n.parentElement.closest('script,style'))continue;const range=document.createRange();range.selectNode(n);const r=range.getBoundingClientRect();if(r.width&&r.height)out.push({x:r.x,y:r.y,width:r.width,height:r.height,text:n.textContent})}for(const sel of ['#tokensecret','#shownkey','#shownsecret']){const e=document.querySelector(sel);if(!e)continue;const r=e.getBoundingClientRect();if(r.width&&r.height)out.push({x:r.x,y:r.y,width:r.width,height:r.height,kind:'one-time test credential'})}return out})()`);writeFileSync(path.replace('.png','-time-rects.json'),J(timeRects));if(sel){const clip=await page.evaluate(`(()=>{const b=document.querySelector(${J(sel)}).getBoundingClientRect();return {x:b.x,y:b.y,width:b.width,height:b.height}})()`);writeFileSync(path.replace('.png','-control-rect.json'),J(clip));}}const val = sel => page.evaluate(`document.querySelector(${J(sel)}).value`);async function clear(sel) { await page.focus(sel); await page.send('Input.dispatchKeyEvent',{type:'keyDown',key:'a',code:'KeyA',modifiers:2,windowsVirtualKeyCode:65});await page.send('Input.dispatchKeyEvent',{type:'keyUp',key:'a',code:'KeyA',modifiers:2,windowsVirtualKeyCode:65});await page.send('Input.dispatchKeyEvent',{type:'keyDown',key:'Backspace',code:'Backspace',windowsVirtualKeyCode:8});await page.send('Input.dispatchKeyEvent',{type:'keyUp',key:'Backspace',code:'Backspace',windowsVirtualKeyCode:8}); }async function shClick(selector) { const b=await page.waitFor(`(()=>{const e=document.querySelector('#selector')?.shadowRoot?.querySelector(${J(selector)});if(!e)return null;e.scrollIntoView({block:'center'});const b=e.getBoundingClientRect();return b.width?{x:b.left+b.width/2,y:b.top+b.height/2}:null})()`,{timeout:30000});for(const [type,buttons]of[['mouseMoved',0],['mousePressed',1],['mouseReleased',0]])await page.send('Input.dispatchMouseEvent',{...b,type,buttons,button:'left',clickCount:1}); }async function httpFace(base,cookie,event,payload) { const r=await fetch(base+'/__hl/emit',{method:'POST',headers:{cookie,'content-type':'application/json'},body:J({t:'emit',i:Date.now(),event,payload})});const j=await r.json();return j.value; }if (!CLIENT) {try {mkdirSync(OUT,{recursive:true});// A dedicated HTTP fixture for the external tickets service. Every write stays in this process.let tickets=[];fixture=createServer(async(req,res)=>{ const u=new URL(req.url,`http://127.0.0.1:${TPORT}`);let b='';for await(const c of req)b+=c;if(u.pathname==='/connect'){res.writeHead(302,{location:u.searchParams.get('return')+'?code=w60&state='+encodeURIComponent(u.searchParams.get('state'))});res.end();return;}res.setHeader('content-type','application/json');if(u.pathname==='/api/connect/exchange'){res.end(J({key:'tktc_w60',project:'w60',title:'W60 test tickets',api:`http://127.0.0.1:${TPORT}/api/projects/w60`}));return;}if(u.pathname==='/api/projects/w60/tickets'&&req.method==='POST'){const j=JSON.parse(b);const t={number:tickets.length+1,subject:j.subject,state:'Open',stateSlug:'open',created:'2026-11-06',updated:'2026-11-06',href:'/projects/w60/'+(tickets.length+1)};tickets.unshift(t);res.writeHead(201);res.end(J({ticket:t}));return;}if(u.pathname==='/api/projects/w60/tickets'){res.end(J({tickets}));return;}res.end('{}');});await new Promise(r=>fixture.listen(TPORT,'127.0.0.1',r));ident=await startIdent({identDir:'/media/STORAGE/projects/WorldAPI/ident.worldapi.org',workDir:join(OUT,'ident'),port:IPORT});track('ident',ident.proc);const alice=await ident.signIn('[email protected]'), bob=await ident.signIn('[email protected]');if(!existsSync(join(OUT,'test-key.pub')))execFileSync('ssh-keygen',['-q','-t','ed25519','-N','','-f',join(OUT,'test-key')]);for(const[tag,appDir]of(process.env.W60_AFTER_ONLY==='1'?[['after',CURRENT]]:process.env.W60_BEFORE_ONLY==='1'?[['before',OLD]]:[['before',OLD],['after',CURRENT]])){tickets=[];const base=`http://w60v3-${tag}.localhost:${PORT}`, repo=`http://alpha.w60v3-${tag}.localhost:${PORT}`;const store=join(OUT,tag);mkdirSync(store,{recursive:true});const app=await ident.registerApp(alice,'W60 '+tag,[base,`http://*.w60v3-${tag}.localhost:${PORT}`]);server=track('gitoria-'+tag,spawn(join(appDir,'bin/hybriel'),['project.hl'],{cwd:appDir,env:{...process.env,GITORIA_PORT:String(PORT),GITORIA_STORAGE:join(store,'mpackdb'),GITORIA_GIT:join(store,'git'),GITORIA_SESSIONS:join(store,'sessions')+'/',GITORIA_WATCH:'0',GITORIA_PUBLIC_URL:base,GITORIA_SSH_SECRET:'w60-fixture',GITORIA_APP_HOSTS:`http://127.0.0.1:${TPORT}`,GITORIA_TICKETS_URL:`http://127.0.0.1:${TPORT}`,IDENT_URL:`http://ident.w60v3-${tag}.localhost:${IPORT}`,IDENT_EXCHANGE_URL:ident.base,IDENT_API_KEY:app.key,IDENT_API_SECRET:app.secret},stdio:['ignore','pipe','pipe']}));const log=[];server.stdout.on('data',x=>log.push(x));server.stderr.on('data',x=>log.push(x));await up(`http://127.0.0.1:${PORT}/api/repos`);// Seed Bob's name in this test store so Alice can add him through the member form.const cb=await fetch(`http://127.0.0.1:${PORT}/login/callback?ident_code=`+await ident.selectorCode(bob,app,base),{redirect:'manual'});const bobCookie=cb.headers.get('set-cookie').split(';')[0];await httpFace(`http://127.0.0.1:${PORT}`,bobCookie,'gitoriaSaveName',['Bob']);const cfg={tag,base,repo,store,alice,app,bobCookie,key:readFileSync(join(OUT,'test-key.pub'),'utf8').trim()};writeFileSync(join(OUT,'client-config.json'),J(cfg));const child=spawn('flock',['/media/STORAGE/claude-scratch/atlas/lisbeth.lock',process.execPath,resolve('tests/cleanup-browser.mjs'),'--client',OUT],{cwd:CURRENT,env:process.env,stdio:'inherit'});track('chrome-client-'+tag,child);const status=await new Promise(r=>child.once('exit',r));check(tag+' Chrome client completes',status===0);await stop(server);writeFileSync(join(OUT,tag+'-server.log'),Buffer.concat(log));server=null;}} catch(e){failed++;console.log('FAIL walk',e.stack);if(page)console.log('CONSOLE',page.dumpConsole().slice(-2500));}finally{try{if(page){await page.setOffline(false);await page.close();}}catch{}try{if(browser)browser.disconnect();}catch{}await stop(server);if(ident)await ident.stop();if(fixture)await new Promise(r=>fixture.close(r));writeFileSync(join(OUT,'processes.json'),J(pids,null,2));writeFileSync(join(OUT,'screenshots.json'),J(shots,null,2));try{const final=await(await fetch('http://127.0.0.1:9223/json/list')).json();writeFileSync(join(OUT,'targets-after.json'),J(final,null,2));}catch{}console.log(`${passed} passed, ${failed} failed`);}process.exitCode=failed?1:0;} else {try {const {tag,base,repo,store,alice,app,bobCookie,key}=CONFIG;const initial=await(await fetch('http://127.0.0.1:9223/json/list')).json();writeFileSync(join(OUT,tag+'-targets-before.json'),J(initial,null,2));browser=await launchBrowser();browser.disconnect=()=>browser.conn.close();page=await browser.newPage();writeFileSync(join(OUT,tag+'-owned-target.txt'),page.targetId);await browser.conn.send('Target.activateTarget',{targetId:page.targetId});// Log in through the actual ident selector, including its hidden bound code bridge.const[n,v]=alice.cookie.split('=');await page.send('Network.setCookie',{name:n,value:v,url:`http://ident.w60v3-${tag}.localhost:${IPORT}/`,httpOnly:true});await page.send('Emulation.setDeviceMetricsOverride',{width:390,height:844,deviceScaleFactor:1,mobile:true});await go(base+'/','#heading');await page.evaluate(`window.__w60Login=0;window.__w60Marker=1;document.querySelector('#identcode').addEventListener('change',()=>window.__w60Login++)`);await shClick('#choose');await shClick('[part~="identity"]');await page.waitForSelector('#nameform',{timeout:30000});await page.type('#displayname','Alice');await page.click('#namesave');await page.waitForSelector('#createform',{timeout:30000});check(`${tag}: hidden identcode login without reload`,await page.evaluate(`window.__w60Login===1&&window.__w60Marker===1&&document.querySelector('#identcode').value===''`));let prSeeded=false;for(const width of [390,1280]){await page.send('Emulation.setDeviceMetricsOverride',{width,height:width===390?844:900,deviceScaleFactor:1,mobile:width<600});await go(base+'/','#createform');await shot(tag,'repositories',width);const slug=width===390?'alpha':'beta';await page.type('#slug',slug);await page.type('#description','W60 test repository');await page.click('#createsave');await page.waitFor(`document.querySelector('#created')?.textContent.includes(${J(slug)})`,{timeout:30000});check(`${tag} ${width}: repo fields clear and row appears once`,await val('#slug')===''&&await val('#description')===''&&await page.evaluate(`[...document.querySelectorAll('#repos li .repo-slug')].filter(e=>e.textContent===${J(slug)}).length===1`));// A refusal preserves the existing draft, just as on the starting tree.await page.type('#slug',slug);await page.type('#description','keep failed draft');await page.click('#createsave');await page.waitFor(`document.querySelector('#createerror').textContent.length>0`);check(`${tag} ${width}: failed repo keeps draft`,await val('#description')==='keep failed draft');await clear('#slug');await clear('#description');await shot(tag,'tokens',width);await page.type('#tokenname','Laptop '+width);await page.click('#tokensave');await page.waitFor(`document.querySelector('#tokenlist').textContent.includes('Laptop ${width}')`,{timeout:30000});check(`${tag} ${width}: token clears and appears once`,await val('#tokenname')===''&&await page.evaluate(`document.querySelectorAll('#tokenlist li').length===1`));await page.click('#tokenlist button');await page.waitFor(`document.querySelectorAll('#tokenlist li').length===0`);await shot(tag,'keys',width);await page.type('#keyname','Laptop '+width);await page.type('#keytext',key);await page.click('#keysave');await page.waitFor(`document.querySelector('#keylist').textContent.includes('Laptop ${width}')`,{timeout:30000});console.log('KEY MEASURE',tag,width,J({name:await val('#keyname'),text:await val('#keytext'),rows:await page.evaluate(`document.querySelectorAll('#keylist li').length`)}));check(`${tag} ${width}: key clears and appears once`,await val('#keyname')===''&&await val('#keytext')===''&&await page.evaluate(`document.querySelectorAll('#keylist li').length===1`));await go(base+'/','#keyform');check(`${tag} ${width}: second visit retains exactly one key`,await page.evaluate(`document.querySelectorAll('#keylist li').length===1`));await page.click('#keylist button');await page.waitFor(`document.querySelectorAll('#keylist li').length===0`);await go(base+'/','#createform');check(`${tag} ${width}: second visit has one repo and no removed credentials`,await page.evaluate(`[...document.querySelectorAll('#repos .repo-slug')].filter(e=>e.textContent===${J(slug)}).length===1&&document.querySelectorAll('#keylist li,#tokenlist li').length===0`));await shot(tag,'org',width);await page.type('#orgslug','team-'+width);await page.click('#orgsave');await page.waitFor(`document.querySelector('#orgs').textContent.includes('team-${width}')`,{timeout:30000});console.log('ORG MEASURE',tag,width,J({slug:await val('#orgslug'),rows:await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length`)}));check(`${tag} ${width}: organization clears and appears once`,await val('#orgslug')===''&&await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length===1`));await go(base+'/','#createform');check(`${tag} ${width}: second visit retains exactly one organization`,await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length===1`));await go(repo+'/settings','#memberform');await shot(tag,'settings',width);await page.type('#membername','Bob');await page.click('#memberadd');await page.waitFor(`document.querySelector('#members').textContent.includes('Bob')`,{timeout:30000});check(`${tag} ${width}: member clears and appears once`,await val('#membername')===''&&await page.evaluate(`document.querySelectorAll('#members li').length===1`));await go(repo+'/settings','#memberform');check(`${tag} ${width}: second visit retains member`,await page.evaluate(`document.querySelectorAll('#members li').length===1`));await page.click('#members button');await page.waitFor(`document.querySelectorAll('#members li').length===0`);await shot(tag,'app',width);await page.type('#appname','Review '+width);await page.type('#apphook',`http://127.0.0.1:${TPORT}/receiver`);await page.click('#appadd');await page.waitFor(`document.querySelector('#applist').textContent.includes('Review ${width}')`,{timeout:30000});check(`${tag} ${width}: app fields clear`,await val('#appname')===''&&await val('#apphook')==='');await page.type('#requiredcontext','build');await page.click('#requiredadd');await page.waitFor(`document.querySelector('#requiredlist').textContent.includes('build')`,{timeout:30000});check(`${tag} ${width}: required context clears`,await val('#requiredcontext')==='');await page.click('#requiredlist button');await page.waitFor(`document.querySelectorAll('#requiredlist li').length===0`);await page.click('#connecttickets');await page.waitFor(`document.querySelector('#connectedto')?.textContent.includes('W60 test tickets')`,{timeout:30000});await go(repo+'/tickets','#newticket');await page.click('#newticket > summary');await shot(tag,'tickets',width);const subject='Ticket '+width;await page.type('#ticketsubject',subject);await page.type('#ticketsummary','A test ticket');await page.click('#ticketsave');await page.waitFor(`document.querySelector('#ticketlist')?.textContent.includes(${J(subject)})`,{timeout:30000});check(`${tag} ${width}: ticket fields clear and row appears once`,await val('#ticketsubject')===''&&await val('#ticketsummary')===''&&await page.evaluate(`[...document.querySelectorAll('#ticketlist .ticket-subject')].filter(e=>e.textContent===${J(subject)}).length===1`));await go(repo+'/tickets','#ticketlist');check(`${tag} ${width}: second visit retains ticket once`,await page.evaluate(`[...document.querySelectorAll('#ticketlist .ticket-subject')].filter(e=>e.textContent===${J(subject)}).length===1`));if(!prSeeded){const W=join(store,'pr-work');mkdirSync(W,{recursive:true});const env={...process.env,GIT_AUTHOR_NAME:'Alice',GIT_AUTHOR_EMAIL:'[email protected]',GIT_COMMITTER_NAME:'Alice',GIT_COMMITTER_EMAIL:'[email protected]',GIT_AUTHOR_DATE:'2020-01-01T12:00:00Z',GIT_COMMITTER_DATE:'2020-01-01T12:00:00Z'};const git=(...args)=>execFileSync('git',args,{cwd:W,env,encoding:'utf8',stdio:['ignore','pipe','pipe']}).trim();git('init','-q','-b','main');writeFileSync(join(W,'base.txt'),'base\n');git('add','.');git('commit','-q','-m','base');git('push','-q',join(store,'git','alpha.git'),'main');git('checkout','-q','-b','feat');writeFileSync(join(W,'f.txt'),'one\ntwo\nthree\n');git('add','.');git('commit','-q','-m','|||PR Review this change');const head=git('rev-parse','HEAD');git('push','-q',join(store,'git','alpha.git'),'feat');const api=async(method,path,obj,token)=>page.evaluate(`fetch(${J('/api'+path)},{method:${J(method)},headers:{'content-type':'application/json',...((${J(token||'')})?{authorization:'Bearer '+${J(token||'')}}:{})},body:${obj===undefined?'undefined':J(J(obj))}}).then(async r=>({status:r.status,json:await r.json()}))`);await go(repo+'/pulls','repo-pulls');await go(repo+'/settings','#appform');const secret=await page.evaluate(`document.querySelector('#shownkey')?.textContent||''`);// The one-time UI key is kept by the test before leaving Settings.let appKey=secret;if(!appKey){const cookies=(await page.cookies([base])).find(x=>x.name==='gitoriasid');const added=await httpFace(`http://127.0.0.1:${PORT}`,cookies.name+'='+cookies.value,'gitoriaAppAdd',['alpha','Thread fixture',`http://127.0.0.1:${TPORT}/receiver`]);appKey=added.key;}const issued=await api('POST','/apps/token',undefined,appKey);if(issued.status!==200)throw new Error('app token setup '+J(issued));const review=await api('POST','/pulls/1/reviews',{head,verdict:'comment',body:'Two thread fixture',comments:[{path:'f.txt',line:1,body:'First thread'},{path:'f.txt',line:2,body:'Second thread'}]},issued.json.token);if(review.status!==201)throw new Error('review setup '+J(review));prSeeded=true;}await go(repo+'/pulls/1','#commentform');await shot(tag,'pr',width);const comment='Comment '+width;await page.type('#commentbody',comment);await page.click('#commentsave');await page.waitFor(`document.querySelector('#conversation').textContent.includes(${J(comment)})`,{timeout:30000});check(`${tag} ${width}: PR comment clears and appears once`,await val('#commentbody')===''&&await page.evaluate(`[...document.querySelectorAll('#conversation li')].filter(e=>e.textContent.includes(${J(comment)})).length===1`));const markThreads=()=>page.evaluate(`for(const li of document.querySelectorAll('#threadlist > li')){const where=li.querySelector('code.where').textContent;li.setAttribute('data-w60-thread',where)}`);await markThreads();const firstThread='#threadlist > li[data-w60-thread="f.txt:1"]',secondThread='#threadlist > li[data-w60-thread="f.txt:2"]';const one=firstThread+' form textarea',two=secondThread+' form textarea',saveOne=firstThread+' form button[type=submit]',saveTwo=secondThread+' form button[type=submit]';await shot(tag,'drafts',width);await page.type(one,'First draft '+width);await page.type(two,'Second draft '+width);console.log('DRAFT MEASURE',tag,width,J({first:await val(one),second:await val(two)}));check(`${tag} ${width}: two simultaneous reply drafts stay separate`,await val(one)==='First draft '+width&&await val(two)==='Second draft '+width);// A whitespace body reaches the server and is refused; HTML required does not reject it.await clear(one);await page.type(one,' ');await page.click(saveOne);await page.waitFor(`document.querySelector('#pullerror').textContent.length>0`,{timeout:30000});check(`${tag} ${width}: failed reply retains both drafts`,await val(one)===' '&&await val(two)==='Second draft '+width);await clear(one);await page.type(one,'First draft '+width);await page.click(saveOne);await page.waitFor(`[...document.querySelectorAll('#threadlist > li')].some(li=>li.querySelector('code.where').textContent==='f.txt:1'&&li.textContent.includes('First draft ${width}'))`,{timeout:30000});await markThreads();check(`${tag} ${width}: only successful reply clears`,await val(one)===''&&await val(two)==='Second draft '+width);if(await val(two)!=='Second draft '+width){await clear(two);await page.type(two,'Second draft '+width);}await page.click(saveTwo);await page.waitFor(`[...document.querySelectorAll('#threadlist > li')].some(li=>li.querySelector('code.where').textContent==='f.txt:2'&&li.textContent.includes('Second draft ${width}'))`,{timeout:30000});await markThreads();check(`${tag} ${width}: second reply clears on its success`,await val(two)==='');await go(repo+'/pulls/1','#commentform');check(`${tag} ${width}: second visit retains comment and both replies`,await page.evaluate(`document.querySelector('#conversation').textContent.includes(${J(comment)})&&document.querySelector('#threadlist').textContent.includes('First draft ${width}')&&document.querySelector('#threadlist').textContent.includes('Second draft ${width}')`));await page.setOffline(true);let offlineVisible=false;try{await page.waitFor(`!!document.querySelector('#offline')`,{timeout:15000});offlineVisible=true;}catch{}check(`${tag} ${width}: Chrome offline shows exact note`,offlineVisible&&await page.evaluate(`document.querySelector('#offline')?.textContent==='You are offline. Repositories and code need the network.'`));if(!offlineVisible)console.log('OFFLINE MEASURE',JSON.stringify(await page.evaluate(`({online:navigator.onLine,visibility:document.visibilityState,animation:getComputedStyle(document.querySelector('net-probe')).animation,reduce:matchMedia('(prefers-reduced-motion: reduce)').matches})`)));await shot(tag,'offline',width);await page.setOffline(false);let hidden=false;try{await page.waitFor(`!document.querySelector('#offline')`,{timeout:15000});hidden=true;}catch{}check(`${tag} ${width}: Chrome online hides note`,hidden);}} catch(e){failed++;console.log('FAIL client',e.stack);if(page)console.log('CONSOLE',page.dumpConsole().slice(-2000));}finally{try{if(page){await page.setOffline(false);await page.close();}}catch{}try{if(browser)browser.disconnect();}catch{}const tag=CONFIG.tag;writeFileSync(join(OUT,tag+'-screenshots.json'),J(shots));writeFileSync(join(OUT,tag+'-result.json'),J({passed,failed}));try{writeFileSync(join(OUT,tag+'-targets-after.json'),J(await(await fetch('http://127.0.0.1:9223/json/list')).json(),null,2));}catch{}console.log(tag,`${passed} passed, ${failed} failed`);}process.exitCode=failed?1:0;}
Branches
Latest commits
- fe209ffeMerge branch 'w56-owner-members' into mainGitoria
- fa0754c8|||PR repository owner transfer and members API (#55)mre
- 8862e537Merge branch 'w55-rename-org' into mainGitoria
- 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
- 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
- 499f25f2Review fixes for the Settings organization move (#53)mre
- ed3b922b|||PR move a repository into an organization in Settings (#53)mre
- 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
- 9f7ce8d8Preserve rename compatibility and live page titlesmre
- c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
- ce08920dMerge branch 'w52c-header-phone' into mainGitoria
- 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
- e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
- c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
- 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
- 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
- 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
- 155861f6Merge branch 'w52-person-approval' into mainGitoria
- b5435de8|||PR person approvals: second Kunibert round (#52)mre
- 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre