tracker
All repositories: gitoria
4.1 KB
// tests/realdata-063.mjs — tracker#29 (mission 063), NOT the gate: on a COPY of live storage/ (STATUS.md has the procedure),// signed in (cookie from .scratch/real-sid) at 390 + 1280: how the checks LOOK on /my/unwatched, a show page (REAL_SHOW) and// /my/movies — per page the count of checks by class and by on-screen look (computed circle fill/stroke, check stroke), and// the screenshot pixel inside the first disc. Then ONE click on /my/unwatched's first check (on the COPY): the row leaves the// list, also after a reload. Screenshots → $REAL_OUT. Env: REAL_PORT (8730), REAL_CHROME (8731), REAL_SHOW (/shows/Foundation).import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';import { launchBrowser } from './cdp.mjs';process.env.HL_CHROME ||= '/opt/google/chrome/chrome';const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8730}`, OUT = process.env.REAL_OUT || '/tmp/w063/real';const SID = readFileSync('.scratch/real-sid', 'utf8').trim();const SHOW = process.env.REAL_SHOW || '/shows/Foundation';mkdirSync(OUT, { recursive: true });const browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8731), Number(process.env.REAL_CHROME || 8731)] });const page = await browser.newPage();const ev = (e) => page.evaluate(e);const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 60000, label: 'hydrated' });const shot = async (n) => writeFileSync(`${OUT}/${n}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));const load = async (path) => { const t = Date.now(); await page.goto(BASE + path, { timeout: 60000 }); await hydrated(); return Date.now() - t; };const looks = () => ev(`JSON.stringify((() => { const cnt = {}; for (const b of document.querySelectorAll('.checkicon')) {const c = getComputedStyle(b.querySelector('circle')), p = getComputedStyle(b.querySelector('path'));const k = b.getAttribute('class') + ' fill=' + c.fill + ' stroke=' + c.stroke + ' mark=' + p.stroke; cnt[k] = (cnt[k] || 0) + 1; } return cnt; })())`);await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });const out = [];for (const [w, h, mobile] of [[390, 844, true], [1280, 900, false]]) {await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: mobile ? 2 : 1, mobile });for (const [name, path] of [['my-unwatched', '/my/unwatched'], ['show', SHOW], ['my-movies', '/my/movies']]) {const ms = await load(path);await page.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 0, y: 0 });if (name === 'show') await ev(`document.querySelector('show-seasons') && document.querySelector('show-seasons').scrollIntoView()`);await page.waitFor(`Array.from(document.querySelectorAll('img')).filter(i => { const r = i.getBoundingClientRect(); return r.top < innerHeight && r.bottom > 0 }).every(i => i.complete)`, { timeout: 10000, label: 'images' }).catch(() => {});await shot(`${name}-${w}`);out.push(`${w} ${path} (${ms} ms): ${await looks()}`);}}// one click on the copy: the first row leaves the list, also after a reloadawait load('/my/unwatched');const first = await ev(`document.querySelector('unwatched-row button.checkicon').value`);const n0 = await ev(`document.querySelectorAll('unwatched-row').length`);const t = Date.now();await page.click('unwatched-row button.checkicon');await page.waitFor(`!document.querySelector('unwatched-row button.checkicon[value="${first}"]')`, { timeout: 30000, label: 'row gone' });const clickMs = Date.now() - t;const n1 = await ev(`document.querySelectorAll('unwatched-row').length`);await load('/my/unwatched');const gone = await ev(`!document.querySelector('unwatched-row button.checkicon[value="${first}"]')`);out.push(`click on /my/unwatched ${first}: ${n0} rows → ${n1} after ${clickMs} ms; after a reload still gone: ${gone}, ${await ev(`document.querySelectorAll('unwatched-row').length`)} rows`);console.log(out.join('\n'));console.log('problems', JSON.stringify(page.problems ? page.problems() : []));await browser.close();
Branches
Latest commits
- 91bcdf0eAvoid per-row list copies and reproduce keyed-row blockersmre
- 2aa22d23log: #36 GOmre
- 833aee2flog: #50 closed, HM56 startedmre
- ac58c1e5mission: HM56mre
- 58979c0clog: HM54 held for decision, DP65 startedmre
- bb2ebc67log: #64 live, #53 mergedmre
- 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre
- 2156cc7flog: HM54 reviewmre
- 9fb82efclog: HM54 gap, fill continuesmre
- b632eb8dlog: HM53 done, HM54 startedmre
- ccb1a263tracker#53: bind editor drafts and use key event focus targetmre
- 3356fcfclog: #52 blocked, HM53 startedmre
- 833dcfc9Merge hm52-search: report only, tracker#52 blocked by framework gapmre
- 73010cc0HM52: report replace-navigation search draft regressionmre
- 1742e92bstatus: DP64 and HM52 runningmre
- 29ad5b58log: #64 merged, DP64 and HM52 startedmre
- fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
- b2e2206dlog: #63 livemre
- 5831e0e0log: HM64 donemre
- 4042b923Flatten catalog membership rows into paired slotsmre