tracker
All repositories: gitoria
4.9 KB
// tests/realdata-m026.mjs — mission 026 (tracker#31, duplicate titles), NOT the gate: what the creator sees on a COPY of live storage// (tests/realdata-m026.sh start …), signed in as az5b2 (cookie from $REAL_SID_FILE). Prints one JSON line per check and writes// screenshots (390 + 1280) to $REAL_SHOTS: /my/series (Reacher's last watched episode, Archive 81's row), Reacher's page (season 3// checked or not), /my/unwatched (Reacher S03 rows), Archive 81's page, the search "archive 81", a talk show with many seasons// (The View) and its full load time. Env: REAL_PORT, REAL_CHROME, REAL_SID_FILE, REAL_SHOTS, REAL_LABEL (file name prefix).import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';import { join } from 'node:path';import { launchBrowser } from './cdp.mjs';process.env.HL_CHROME ||= '/opt/google/chrome/chrome';const PORT = Number(process.env.REAL_PORT || 8730), BASE = `http://127.0.0.1:${PORT}`;const SID = readFileSync(process.env.REAL_SID_FILE, 'utf8').trim(), SHOTS = process.env.REAL_SHOTS, LABEL = process.env.REAL_LABEL || 'x';if (SHOTS) mkdirSync(SHOTS, { recursive: true });const browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8729), Number(process.env.REAL_CHROME || 8729)] });const page = await browser.newPage();await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });const ev = (e) => page.evaluate(e);const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 120000, label: 'hydrated' });const open = async (path) => { const t = Date.now(); await page.goto(BASE + path, { timeout: 120000 }); await hydrated(); return Date.now() - t; };const shot = async (name, full) => {if (!SHOTS) return;for (const [w, h, m] of [[390, 844, true], [1280, 900, false]]) {await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: 1, mobile: m });await new Promise(r => setTimeout(r, 300));const opts = { format: 'png' };if (full) { const hh = await ev('document.documentElement.scrollHeight'); opts.clip = { x: 0, y: 0, width: w, height: Math.min(hh, 6000), scale: 1 }; opts.captureBeyondViewport = true; }writeFileSync(join(SHOTS, `${LABEL}-${name}-${w}.png`), Buffer.from((await page.send('Page.captureScreenshot', opts)).data, 'base64'));}await page.send('Emulation.clearDeviceMetricsOverride', {});};const out = {};try {await open('/my/series');out.mySeries = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('my-show-row')).filter(r => /Reacher|Archive 81|Flight Attendant|Raised by Wolves/.test(r.textContent)).map(r => [r.querySelector('a.myshow-title').textContent, r.querySelector('a.myshow-title').getAttribute('href'), (r.querySelector('my-show-episode') || {}).textContent || '']))`));out.mySeriesRows = await ev(`document.querySelectorAll('my-show-row').length`);await shot('my-series');const seasons = () => ev(`JSON.stringify(Array.from(document.querySelectorAll('season-row')).map(r => r.querySelector('season-label').textContent + ': ' + r.querySelector('season-count').textContent + ' ' + ((r.querySelector('button.checkicon') || {}).getAttribute ? r.querySelector('button.checkicon').getAttribute('class') : '')))`);await open('/series/Reacher');out.reacher = JSON.parse(await seasons());await shot('reacher', true);await open('/my/unwatched');out.unwatchedReacher = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('unwatched-row')).filter(r => /Reacher/.test(r.textContent)).map(r => r.querySelector('unwatched-episode').textContent))`));out.unwatchedRows = await ev(`document.querySelectorAll('unwatched-row').length`);await shot('my-unwatched');out.archiveLoad = await open('/series/Archive-81');out.archive = { h1: await ev(`(document.querySelector('show-header h1 type-name') || {}).textContent`), seasons: JSON.parse(await seasons()), path: await ev('location.pathname') };await shot('archive-81', true);await open('/search/archive%2081');out.search = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('a.search-title')).map(a => a.textContent + ' ' + a.getAttribute('href')))`));await shot('search-archive');for (const p of ['/shows/The-View', '/shows/EastEnders', '/series/EastEnders']) {const r = await fetch(BASE + p, { redirect: 'manual' });if (r.status === 200) { out.talkPath = p; break; }if (r.status === 301) { out.talkPath = r.headers.get('location').replace(BASE, ''); break; }}if (out.talkPath) {out.talkLoads = [];for (let i = 0; i < 3; i++) out.talkLoads.push(await open(out.talkPath));out.talkSeasons = await ev(`document.querySelectorAll('season-row').length`);await shot('talk');}} catch (e) { out.error = String(e.stack || e); }console.log(JSON.stringify(out, null, 1));await browser.close();process.exit(out.error ? 1 : 0);
Branches
Latest commits
- 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
- 07a5c883HM65 report measured field projection and complete validationmre
- 0eab858fRead only catalog date fields during the episode boot scanmre
- d3179273log: HM65 hl:heap vendoringmre
- cb78a1a0HM65 report missing heap diagnostic package with repromre
- 89606a5cHM65 briefmre
- 096ce0d4log: DP69 live on day48mre
- b3d8a80bDP69 brief, RV48 mergedmre
- ce6d7d32Merge rv48: Hybriel day48mre
- 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
- 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
- 4a802ae7status: RV48 runningmre
- 0a5412b6RV48 brief, day48 outmre
- 56665efelog: CB69 mergedmre
- 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
- e55b379dKeep shared app title independent of the route import graphmre
- 9a99659blog: hybriel#334, batch waits for day48mre
- 85fa6c9blog: CB68 result, CB69 startedmre
- 2f07c1b7log: DP68 boot gate failed, CB68mre
- 9652782dlog: HM59 merged, DP68 startedmre