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
- c41587d2Merge branch 'bs2' into mainTracker
- 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
- 019d5cedMerge branch 'records-1110' into mainTracker
- f88ae8b9|||PR records: day56 toggle live, reviewTracker
- b6b3bb4dMerge branch 'ap56e' into mainTracker
- 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
- 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
- 4b54f6f9Merge branch 'records-audit' into mainTracker
- cab4a3bc|||PR records: branch audit, PR-onlyTracker
- 641e1c4cMerge branch 'records-dp71' into mainTracker
- 85a6e9f5|||PR records: DP71 checked in ChromeTracker
- f5be5f18records: gitoria PR-only planTracker
- 46a37036records: DP71 liveTracker
- 3bcb7039Status/log: DP71 in progressTracker
- 5b3a5693Log: SR1b merged via PR 2, DP71 startedTracker
- 783957c2Merge branch 'sr1-search' into mainTracker
- 792b9652README: search results come from the routeTracker
- fd8570b1|||PR search: one server exchange per keystrokeTracker
- e8f5cbcaLog: SR1 result, SR1bTracker
- 8ad275a4Log/status: tracker 68, SR1Tracker