gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit27b6a09e27b6a09enotes#8: Style blocks in the nested form (note-list, note-editor, .ask with their children nested, :empty as a nested pseudo-class); the same CSS rules, the pages look the samemre27b6a09e/tests/e2e-chrome.mjs

22.1 KB

  1. // tests/e2e-chrome.mjs (mission 010): END TO END in a REAL, already-running Chrome (lisbeth's LLM test Chrome through an ssh
  2. // tunnel), real mouse clicks and key events only, on a COPY of a deploy backup (a session of the creator is written into the copy).
  3. // node tests/e2e-chrome.mjs <label> <backup.tgz> <app-port> <cdp-port> <shots-dir>
  4. // <app-port> is also the port of a REVERSE forward on lisbeth (ssh -R <app-port>:127.0.0.1:<app-port>), so Chrome there reaches
  5. // http://127.0.0.1:<app-port>; <cdp-port> is the local end of ssh -L <cdp-port>:127.0.0.1:9223 lisbeth. ONE existing about:blank tab
  6. // is navigated (never /json/new, no clipboard); it is put back to about:blank at the end.
  7. // At 390 and 1280 px: open the list, New note, type a heading, text, bold (Ctrl+B), a list and a table with real keys, wait for
  8. // the save, RELOAD (the text is back), go OFFLINE (Network.emulateNetworkConditions, page and worker), reload offline, the list
  9. // and the note open, type more offline, back online → the server has it. Works on the old editor (md-editor.js) and the block.
  10. // MISSION 011 (the theme): also, per width, the 390 AUDIT of each page (tests/mobile-measure.js: taps < 44, fields < 16 px, elements wider
  11. // than the screen, text < 14 px; list, a note, new note, login-failed, offline list → <shots>/<label>-audits.json), the USER MENU and the
  12. // phone's SIDEBAR by real clicks, opening an existing note from the list by a click, and DELETE of the test note (real clicks, on the
  13. // copy). Runs on the old tree too (copy this file + mobile-measure.js into it): the steps that need the theme's menus are skipped there.
  14. import { spawn, execFileSync } from 'node:child_process';
  15. import { writeFileSync, mkdirSync, rmSync, existsSync } from 'node:fs';
  16. import { createHash, randomBytes } from 'node:crypto';
  17. import { join, resolve, dirname } from 'node:path';
  18. import { fileURLToPath } from 'node:url';
  19. import { readFileSync } from 'node:fs';
  20. const [LABEL, tgz, portArg, cdpArg, shots] = process.argv.slice(2);
  21. const APP = resolve(dirname(fileURLToPath(import.meta.url)), '..');
  22. const PORT = Number(portArg), CDP = Number(cdpArg);
  23. const BASE = `http://${process.env.E2E_HOST || '127.0.0.1'}:${PORT}`, API = `http://127.0.0.1:${PORT}`; // E2E_HOST=localhost: another cookie jar than other workers' 127.0.0.1 apps (cookies ignore ports)
  24. const W = join(APP, '.scratch/e2e-chrome-' + LABEL);
  25. const USER = '0muh6o5a3kkd';
  26. rmSync(W, { recursive: true, force: true });
  27. mkdirSync(join(W, 'data'), { recursive: true }); mkdirSync(join(W, 'sessions'), { recursive: true }); mkdirSync(shots, { recursive: true });
  28. execFileSync('tar', ['-xzf', resolve(tgz), '-C', join(W, 'data'), 'storage/mpackdb']);
  29. const sid = randomBytes(16).toString('hex'), now = Date.now();
  30. writeFileSync(join(W, 'sessions', createHash('sha256').update(sid).digest('hex')),
  31. JSON.stringify({ created: now, data: { tag: 'e2e' }, handled: [], id: sid, seen: now, user: { id: USER } }), { mode: 0o600 });
  32. let failures = 0, passes = 0;
  33. const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} [${LABEL}] ${label}${ok ? '' : ' — ' + detail}`); if (ok) passes++; else failures++; };
  34. const sleep = (ms) => new Promise(r => setTimeout(r, ms));
  35. const J = JSON.stringify;
  36. let log = '';
  37. const srv = spawn(join(APP, 'bin/hybriel'), ['project.hl'], { cwd: APP, stdio: ['ignore', 'pipe', 'pipe'],
  38. env: { ...process.env, NOTES_PORT: String(PORT), NOTES_PUBLIC_URL: BASE, NOTES_STORAGE: join(W, 'data/storage/mpackdb'),
  39. NOTES_SESSIONS: join(W, 'sessions') + '/', NOTES_WATCH: '0', IDENT_URL: 'http://ident.test', IDENT_API_KEY: 'pk_e2e', IDENT_API_SECRET: 'sk_e2e' } });
  40. srv.stdout.on('data', d => log += d); srv.stderr.on('data', d => log += d);
  41. console.log('server pid', srv.pid);
  42. // ---- a tiny CDP client (one existing tab + the browser socket for the service workers) ----
  43. function connect(url) {
  44. return new Promise((ok, no) => {
  45. const ws = new WebSocket(url); let n = 0; const pend = new Map(); const handlers = [];
  46. ws.addEventListener('message', (m) => { const d = JSON.parse(m.data); if (d.id && pend.has(d.id)) { const p = pend.get(d.id); pend.delete(d.id); d.error ? p.no(new Error(d.error.message)) : p.ok(d.result); } else handlers.forEach(h => h(d)); });
  47. ws.addEventListener('open', () => ok({ ws, on: (h) => handlers.push(h), send: (method, params = {}, sessionId) => new Promise((ok2, no2) => { const id = ++n; pend.set(id, { ok: ok2, no: no2 }); ws.send(J({ id, method, params, ...(sessionId ? { sessionId } : {}) })); }) }));
  48. ws.addEventListener('error', () => no(new Error('ws error ' + url)));
  49. });
  50. }
  51. const get = async (path) => (await fetch(`http://127.0.0.1:${CDP}${path}`)).json();
  52. const api = async (path) => (await fetch(API + path, { headers: { cookie: 'notessid=' + sid } })).json();
  53. const alive = async () => { const out = []; for (const n of (await api('/api/notes')).notes.filter(n => !n.gone)) out.push({ ...n, text: (await api('/api/notes?id=' + n.id)).text }); return out; };
  54. let page = null, browser = null, tabUrlBefore = null;
  55. const ev = async (expr) => { const r = await page.send('Runtime.evaluate', { expression: expr, returnByValue: true, awaitPromise: true }); if (r.exceptionDetails) throw new Error('evaluate: ' + (r.exceptionDetails.exception && r.exceptionDetails.exception.description || r.exceptionDetails.text)); return r.result.value; };
  56. const waitFor = async (expr, label, timeout = 40000) => { const t0 = Date.now(); for (;;) { let v = false; try { v = await ev(expr); } catch {} if (v) return v; if (Date.now() - t0 > timeout) { let d = ''; try { d = await ev(`JSON.stringify({ path: location.pathname, hl: !!window.__hl, nt: !!document.getElementById('notetext'), md: !!document.querySelector('md-editor'), art: !!document.querySelector('md-editor article'), kids: document.querySelector('md-editor article') ? document.querySelector('md-editor article').children.length : -1, body: document.body.innerText.slice(0, 120) })`); } catch (e) { d = String(e); } throw new Error('timeout: ' + label + ' ' + d); } await sleep(100); } };
  57. const shot = async (name) => { const { data } = await page.send('Page.captureScreenshot', { format: 'png' }); writeFileSync(join(shots, `${LABEL}-${name}.png`), Buffer.from(data, 'base64')); };
  58. const size = async (w, h) => { await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: 1, mobile: w < 600 }); await sleep(400); };
  59. const click = async (x, y) => { for (const [type, buttons] of [['mouseMoved', 0], ['mousePressed', 1], ['mouseReleased', 0]]) await page.send('Input.dispatchMouseEvent', { type, x: Math.round(x), y: Math.round(y), button: 'left', clickCount: 1, buttons }); await sleep(120); };
  60. const clickSel = async (sel) => { const r = await ev(`(() => { const e = document.querySelector(${J(sel)}); if (!e) return null; e.scrollIntoView({ block: 'center' }); const q = e.getBoundingClientRect(); return { x: q.left + q.width / 2, y: q.top + q.height / 2 }; })()`); if (!r) throw new Error('no ' + sel); await click(r.x, r.y); };
  61. // the editor surface, old (shadow DOM, [part~=editor]) or new (the block's light DOM, article)
  62. const SURF = `(document.querySelector('md-editor') && ((document.querySelector('md-editor').shadowRoot && document.querySelector('md-editor').shadowRoot.querySelector('[part~=editor]')) || document.querySelector('md-editor article')))`;
  63. const value = () => ev(`(() => { const n = document.getElementById('notetext'); if (!n) return null; const i = n.querySelector('input[name=text]'); return i ? i.value : n.value; })()`);
  64. const clickEditor = async () => { const r = await ev(`(() => { const s = ${SURF}; if (!s) return null; s.scrollIntoView({ block: 'center' }); const q = s.getBoundingClientRect(); return { x: q.left + 24, y: q.top + 16 }; })()`); if (!r) throw new Error('no editor surface'); await click(r.x, r.y); };
  65. const key = async (k, code, vk, mods = 0, text) => { const t = text && !(mods & 2) ? text : undefined; await page.send('Input.dispatchKeyEvent', { type: t ? 'keyDown' : 'rawKeyDown', modifiers: mods, key: k, code, windowsVirtualKeyCode: vk, nativeVirtualKeyCode: vk, ...(t ? { text: t, unmodifiedText: t } : {}) }); await page.send('Input.dispatchKeyEvent', { type: 'keyUp', modifiers: mods, key: k, code, windowsVirtualKeyCode: vk, nativeVirtualKeyCode: vk }); await sleep(40); };
  66. const enter = () => key('Enter', 'Enter', 13, 0, '\r');
  67. const tab = () => key('Tab', 'Tab', 9);
  68. const ctrl = (k, code, vk) => key(k, code, vk, 2);
  69. const type = async (s) => { for (const ch of s) { await page.send('Input.dispatchKeyEvent', { type: 'keyDown', text: ch, unmodifiedText: ch, key: ch }); await page.send('Input.dispatchKeyEvent', { type: 'keyUp', key: ch }); } await sleep(80); };
  70. const hydrated = () => waitFor(`!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1`, 'hydrated');
  71. const MEASURE = readFileSync(join(APP, 'tests/mobile-measure.js'), 'utf8');
  72. const audits = [];
  73. const audit = async (name, W_) => {
  74. const m = await ev(`window.__W = ${W_};` + MEASURE);
  75. const r = { page: name, W: W_, scrollWidth: m.docScrollWidth, taps: m.taps, tapsSmall: m.tapsSmall, small: m.tapsSmallList.slice(0, 6), inputs: m.inputs, inputsSmall: m.inputsSmall, inputsSmallList: m.inputsSmallList, textSmall: m.textSmall, textSmallList: m.textSmallList.slice(0, 4), wide: m.wide, wideList: m.wideList.slice(0, 4), header: m.headerH };
  76. audits.push(r); console.log('AUDIT ' + J(r)); await shot(`${W_}-audit-${name}`);
  77. };
  78. // MISSION 013 (theme 76f99f6): the main menu marks the current page beyond colour — exactly one visible link with aria-current="page", class
  79. // current and an inset accent bar (box-shadow). Notes has ONE item (Notes, `current = true`: the shell passes no path), so "the marker moves"
  80. // is shown as: marked on the list AND on a note page, and still marked after a REAL click on the item itself (note → list).
  81. const markSel = (W_) => W_ < 600 ? '#sidebar main-menu a' : 'application-header main-menu a';
  82. const markInfo = (W_) => ev(`(() => { const ls = [...document.querySelectorAll(${J(markSel(W_))})].filter(a => a.getBoundingClientRect().width > 0); const cur = ls.filter(a => a.getAttribute('aria-current') === 'page'); const c = cur[0]; return { links: ls.length, current: cur.length, text: c && c.textContent, cls: c && c.className, shadow: c && getComputedStyle(c).boxShadow }; })()`);
  83. const markOk = (m) => m.links === 1 && m.current === 1 && !!m.cls && m.cls.includes('current') && !!m.shadow && m.shadow !== 'none';
  84. const shows = (sel) => ev(`(() => { const e = document.querySelector(${J(sel)}); return !!e && e.getBoundingClientRect().width > 0; })()`);
  85. const esc = () => key('Escape', 'Escape', 27);
  86. const overflow = () => ev(`document.documentElement.scrollWidth > innerWidth`);
  87. try {
  88. for (let i = 0; i < 480; i++) { try { if ((await fetch(API + '/')).ok) break; } catch {} await sleep(250); }
  89. check('the copy: the session is the creator', (await api('/api/me')).user === USER);
  90. let n0 = (await alive()).length;
  91. // the ONE existing tab: about:blank (never /json/new)
  92. const pages = (await get('/json/list')).filter(t => t.type === 'page');
  93. const tabs = pages.filter(t => t.url === 'about:blank');
  94. if (!tabs.length) tabs.push(...pages.filter(t => t.url.startsWith('http://127.0.0.1:')).slice(0, 1)); // the shared Chrome: a stale localhost tab of an earlier run, taken under the lock, left at about:blank
  95. if (!tabs.length) throw new Error('no existing about:blank (or stale localhost) tab');
  96. tabUrlBefore = tabs[0].url;
  97. page = await connect(tabs[0].webSocketDebuggerUrl.replace(/ws:\/\/[^/]+/, `ws://127.0.0.1:${CDP}`));
  98. browser = await connect((await get('/json/version')).webSocketDebuggerUrl.replace(/ws:\/\/[^/]+/, `ws://127.0.0.1:${CDP}`));
  99. for (const m of ['Page.enable', 'Runtime.enable', 'Network.enable']) await page.send(m);
  100. await page.send('Network.setCookie', { name: 'notessid', value: sid, url: BASE + '/' });
  101. const workers = new Map();
  102. const setOffline = async (off) => {
  103. await page.send('Network.emulateNetworkConditions', { offline: off, latency: 0, downloadThroughput: -1, uploadThroughput: -1 });
  104. const { targetInfos } = await browser.send('Target.getTargets');
  105. for (const t of targetInfos) if (t.type === 'service_worker' && t.url.startsWith(BASE) && !workers.has(t.targetId)) {
  106. const { sessionId } = await browser.send('Target.attachToTarget', { targetId: t.targetId, flatten: true });
  107. await browser.send('Network.enable', {}, sessionId); workers.set(t.targetId, sessionId);
  108. }
  109. for (const s of workers.values()) await browser.send('Network.emulateNetworkConditions', { offline: off, latency: 0, downloadThroughput: -1, uploadThroughput: -1 }, s);
  110. };
  111. const goto = async (url) => { await page.send('Page.navigate', { url }); await sleep(300); await page.send('Page.bringToFront'); };
  112. for (const [W_, H_] of [[390, 844], [1280, 900]]) {
  113. const tag = String(W_);
  114. n0 = (await alive()).length; // each width starts from what the copy holds now
  115. const heading = `E2E ${LABEL} ${tag}`;
  116. await size(W_, H_);
  117. await goto(BASE + '/');
  118. await waitFor(`document.querySelectorAll('#notes a').length > 0`, 'list', 60000); await hydrated();
  119. await waitFor(`!!navigator.serviceWorker.controller`, 'service worker controls the page', 40000);
  120. await shot(`${tag}-1-list`);
  121. check(`${tag}: the list shows the copy's notes`, (await ev(`document.querySelectorAll('#notes a').length`)) === n0, String(n0));
  122. await audit('list', W_);
  123. if (W_ >= 600) { const m = await markInfo(W_); check(`${tag}: the header's menu marks the list page (aria-current, accent bar) ${J(m)}`, markOk(m), J(m)); await shot(`${tag}-1e-menu-marked`); }
  124. // the user menu (the theme's icon; the old header shows Log out itself) and the phone's sidebar, by real clicks
  125. check(`${tag}: Log out and the ident selector stand in the header (no user menu)`, await shows('#logout') && await shows('ident-selector')); await shot(`${tag}-1b-header`);
  126. if (W_ < 600 && await ev(`!!document.querySelector('button.menu-toggle')`)) {
  127. await clickSel('button.menu-toggle'); await waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, 'sidebar'); await sleep(300);
  128. check(`${tag}: the ☰ opens the sidebar with the main menu (${J(await ev(`[...document.querySelectorAll('#sidebar main-menu a')].map(a => a.textContent)`))})`, (await ev(`document.querySelectorAll('#sidebar main-menu a').length`)) === 1);
  129. await shot(`${tag}-1c-sidebar`);
  130. { const m = await markInfo(W_); check(`${tag}: the sidebar's menu marks the page (aria-current, accent bar) ${J(m)}`, markOk(m), J(m)); }
  131. await esc(); await sleep(300);
  132. }
  133. // an existing note of the copy opens by a click on the list
  134. if (n0 > 0) {
  135. await clickSel('#notes a');
  136. await waitFor(`!!document.getElementById('notetext') && ${SURF} && ${SURF}.children.length > 0`, 'an existing note opens', 60000); await sleep(400);
  137. check(`${tag}: a click on a list entry opens that note (${await ev('location.pathname')})`, /^\/note\//.test(await ev('location.pathname')) && (await value()) !== null && (await value()).length > 0);
  138. await shot(`${tag}-1d-note`); await audit('note', W_);
  139. if (W_ >= 600 || await ev(`!!document.querySelector('button.menu-toggle')`)) {
  140. if (W_ < 600) { await clickSel('button.menu-toggle'); await waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, 'sidebar on the note'); await sleep(300); }
  141. const notePath = await ev('location.pathname');
  142. const m = await markInfo(W_); check(`${tag}: the menu marks the page on a note too ${J(m)}`, markOk(m), J(m)); await shot(`${tag}-1f-menu-on-note`);
  143. await clickSel(markSel(W_));
  144. await waitFor(`location.pathname === '/' && document.querySelectorAll('#notes a').length > 0`, 'the menu item leads to the list', 60000); await hydrated(); await sleep(300);
  145. if (W_ < 600) { await clickSel('button.menu-toggle'); await waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, 'sidebar on the list'); await sleep(300); }
  146. const m2 = await markInfo(W_); check(`${tag}: after a real click on the item the list page is marked ${J(m2)}`, markOk(m2), J(m2)); await shot(`${tag}-1g-menu-after-click`);
  147. if (W_ < 600) { await esc(); await sleep(300); }
  148. await goto(BASE + notePath);
  149. await waitFor(`!!document.getElementById('notetext') && ${SURF} && ${SURF}.children.length > 0`, 'the note opens again', 60000); await sleep(400);
  150. }
  151. if (W_ < 600) { await clickSel('.back'); await waitFor(`!!document.querySelector('note-list') && document.querySelector('note-list').getBoundingClientRect().width > 0`, 'back to the list'); }
  152. }
  153. await clickSel('#newnote');
  154. await waitFor(`/^\\/note\\/l[0-9a-f]+$/.test(location.pathname) && ${SURF} && ${SURF}.children.length > 0`, 'the new note and its editor');
  155. await sleep(500);
  156. await audit('new-note', W_);
  157. await clickEditor();
  158. // real keys: heading, text with bold, a list, a table
  159. await type('# ' + heading); await enter();
  160. await type('Plain '); await ctrl('b', 'KeyB', 66); await type('bold'); await ctrl('b', 'KeyB', 66); await type(' end'); await enter();
  161. await type('| Item | Qty |'); await enter(); await type('|:---|---:|'); await enter();
  162. await type('milk'); await tab(); await type('2'); await enter(); await enter();
  163. await type('- first'); await enter(); await type('second');
  164. await sleep(300);
  165. const typed = await value();
  166. await shot(`${tag}-2-typed`);
  167. check(`${tag}: typed heading, bold, list and table are Markdown in the note`, typed && typed.startsWith('# ' + heading) && /\*\*bold\*\*/.test(typed) && /^- first$/m.test(typed) && /^- second$/m.test(typed) && /\| Item +\| +Qty \|/.test(typed) && /milk/.test(typed) && /\| *2 *\|/.test(typed), J(typed));
  168. check(`${tag}: the editor shows a heading, a bold word, a list and a table`, await ev(`(() => { const s = ${SURF}; return !!(s.querySelector('h1') && s.querySelector('strong, b') && s.querySelector('ul li') && s.querySelector('table')); })()`));
  169. let saved = null;
  170. for (let i = 0; i < 80 && !saved; i++) { saved = (await alive()).find(n => n.text === typed); if (!saved) await sleep(250); }
  171. check(`${tag}: the server has the note, byte for byte what the editor holds`, !!saved, J(typed));
  172. check(`${tag}: no sideways scroll`, !(await overflow()));
  173. // RELOAD
  174. await goto(BASE + '/note/' + (saved ? saved.id : ''));
  175. await waitFor(`!!document.getElementById('notetext') && ${SURF} && ${SURF}.children.length > 0`, 'reloaded note', 60000);
  176. await sleep(600);
  177. const reloaded = await value();
  178. await shot(`${tag}-3-reloaded`);
  179. check(`${tag}: after a reload the note is saved and the same`, reloaded === typed, J(reloaded));
  180. // OFFLINE
  181. await setOffline(true);
  182. await goto(BASE + '/note/' + saved.id);
  183. await waitFor(`!!window.__hl && !!document.getElementById('notetext') && ${SURF} && ${SURF}.children.length > 0`, 'offline note', 60000);
  184. await sleep(800);
  185. check(`${tag}: offline the note opens with its text`, (await value()) === typed && (await ev(`document.querySelectorAll('#notes a').length`)) === n0 + 1, J(await value()));
  186. await clickEditor(); await ctrl('End', 'End', 35); await type(' offline' + tag);
  187. await sleep(2200);
  188. const offTyped = await value();
  189. check(`${tag}: offline the editor works (typing lands) and the page says it is offline`, /offline\d+$/.test(offTyped || '') && /Offline/.test(await ev(`(document.getElementById('syncstate') || {}).textContent || ''`)), J(offTyped));
  190. await shot(`${tag}-4-offline`);
  191. await goto(BASE + '/');
  192. await waitFor(`document.querySelectorAll('#notes a').length > 0`, 'offline list', 60000);
  193. check(`${tag}: offline the list opens`, (await ev(`document.querySelectorAll('#notes a').length`)) === n0 + 1);
  194. await audit('offline-list', W_);
  195. await setOffline(false);
  196. let back = null;
  197. for (let i = 0; i < 160 && !back; i++) { back = (await alive()).find(n => n.text === offTyped); if (!back) await sleep(250); }
  198. check(`${tag}: back online the offline edit reached the server (same note, no copy)`, !!back && back.id === saved.id && (await alive()).length === n0 + 1, J(offTyped));
  199. check(`${tag}: no sideways scroll at the end`, !(await overflow()));
  200. // login-failed page (the callback without a code), audited, then DELETE the test note by real clicks (on the copy)
  201. await goto(BASE + '/login/callback'); await waitFor(`!!document.getElementById('loginfailed')`, 'login failed page', 40000); await sleep(800);
  202. await audit('login-failed', W_);
  203. await goto(BASE + '/note/' + saved.id);
  204. await waitFor(`!!document.getElementById('delete') && !!document.getElementById('notetext')`, 'the note to delete', 60000); await sleep(500);
  205. await clickSel('#delete'); await waitFor(`document.getElementById('deleteask').classList.contains('open')`, 'delete question'); await shot(`${tag}-5a-delete-ask`);
  206. await clickSel('#deleteyes');
  207. let gone = false;
  208. for (let i = 0; i < 80 && !gone; i++) { gone = !(await alive()).some(n => n.id === saved.id); if (!gone) await sleep(250); }
  209. check(`${tag}: Delete (real clicks) removes the test note on the server; the list is back to ${n0} notes`, gone && (await alive()).length === n0 && (await ev(`document.querySelectorAll('#notes a').length`)) === n0, String((await alive()).length));
  210. await goto(BASE + '/'); await waitFor(`document.querySelectorAll('#notes a').length > 0`, 'list again', 60000);
  211. await shot(`${tag}-5-end`);
  212. }
  213. check('the server logged no error', !/error|Error/.test(log.replace(/error absorbed/g, '')), log.slice(-400));
  214. } catch (e) {
  215. console.log('FAIL crashed — ' + (e && e.stack || e)); failures++; console.log(log.slice(-800));
  216. } finally {
  217. try { if (page) { await page.send('Network.emulateNetworkConditions', { offline: false, latency: 0, downloadThroughput: -1, uploadThroughput: -1 }); await page.send('Emulation.clearDeviceMetricsOverride'); await page.send('Page.navigate', { url: 'about:blank' }); } } catch {}
  218. try { if (page) page.ws.close(); if (browser) browser.ws.close(); } catch {}
  219. try { srv.kill('SIGTERM'); } catch {}
  220. await sleep(1000);
  221. rmSync(W, { recursive: true, force: true });
  222. writeFileSync(join(shots, `${LABEL}-audits.json`), J(audits, null, 1));
  223. console.log(`${passes} passed, ${failures} failed (copy deleted: ${!existsSync(W)})`);
  224. process.exit(failures ? 1 : 0);
  225. }

Branches

Latest commits

  • 27b6a09enotes#8: Style blocks in the nested form (note-list, note-editor, .ask with their children nested, :empty as a nested pseudo-class); the same CSS rules, the pages look the samemre
  • 71a9538bnotes: B27W report, log linemre
  • 78ba0073notes: an ident access key (Authorization: Bearer idt_…) reads and writes its identity's notes through /api/me and /api/notes; gate tests/ident-access-notes.mjs (ident#27)mre
  • 3de46dacnotes: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 73+5 failing → 78 passedmre
  • 5909d458notes: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows without a delimiter row; tickets#49, notes#5)mre
  • 98bd6a98N5b: pipe rows without a delimiter row are a table (MdEditor ad4e929, plain copy); gate tests/dashboard-table.mjs; reportmre
  • dbf93319N5 report: components gate rerun 613 passed, 0 failedmre
  • 3a8bc0d2N5: empty Table-button table is written as a real pipe table (MdEditor 4bd1112, plain copy); gate tests/table-button.mjs; reportmre
  • c16bd443N5: step 1 report (tables pass locally; his DASHBOARD note has no delimiter row)mre
  • 6091320anotes: MdEditor 7437e32 (surface drawn at once when the page is claimed); gate measures claim-to-text on 5 note loads at 1280 and 390mre
  • 0aa9277enotes: move each component's styles into its own Style block (shell and header selector in main.hl, list, editor frame and delete question in notes.hl); styles.hl keeps the theme inherit, the accent and the message colour; .gitignore ignores a bin symlink too; tests/shots.mjs for the pixel comparemre
  • 9ba01de3notes: write the standby service out in full so the boot gate can read the main servicemre
  • 98cab40anotes: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
  • 1fadb473notes gate: the editor table now has 1 px cell lines from the notes thememre
  • 8762115cnotes: take the components e54f83a (paste as Markdown, text typed before the editor is built is kept, Table button); table lines come from the notes thememre
  • ac23e194ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • 2804f0d3Merge branch 'iw-ident-widget'mre
  • 52d8d242notes: e2e script checks Log out and the selector in the header instead of the user menumre
  • e5abf7b7notes header: the selector alone top right plus Log out as before the theme missions; the user icon is gonemre
  • a2e343aeident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre