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
- c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
- 0b86324aMerge branch 'records-dp73' into mainTracker
- 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
- 613ae0ecMerge branch 'bs3' into mainTracker
- 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
- 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
- 310613f1Merge branch 'records-dp72' into mainTracker
- 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
- 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