tracker
All repositories: gitoria
3.7 KB
// tests/realdata-m031.mjs — mission 031 (tracker#32 header + the WorldAPI theme), NOT the gate. Screenshots of real pages against a// server started by tests/realdata-m028.sh on a COPY of live storage/: every path of REAL_PATHS at 390 and 1280 px, signed out and// signed in as the creator (cookie from $REAL_SID_FILE), plus the header states on `/` (phone: overlay, search, user/ident dropdown;// desktop: user dropdown). Prints per shot the header's height, sideways scroll and console problems. Files: $REAL_OUT/<w>-<in|out>-<name>.png// Env: REAL_PORT, REAL_CHROME, REAL_SID_FILE, REAL_OUT, REAL_PATHS (comma list).import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';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(), OUT = process.env.REAL_OUT;const PATHS = (process.env.REAL_PATHS || '/,/series/Star-Trek-Picard,/movies/Star-Trek-First-Contact,/person/Patrick-Stewart,/my/series').split(',');mkdirSync(OUT, { recursive: true });const nameOf = (p) => (p === '/' ? 'home' : p.slice(1).replace(/[^A-Za-z0-9-]+/g, '_'));const browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8729), Number(process.env.REAL_CHROME || 8729)] });try {for (const who of ['out', 'in']) {for (const w of [390, 1280]) {const page = await browser.newPage();await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: w === 390 ? 844 : 900, deviceScaleFactor: 1, mobile: w === 390 });if (who === 'in') await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });const shot = async (name) => {await new Promise(r => setTimeout(r, 400));const info = await page.evaluate(`JSON.stringify({ header: Math.round((document.querySelector('application-header') || document.body).getBoundingClientRect().height), sideways: document.documentElement.scrollWidth > innerWidth })`);writeFileSync(`${OUT}/${w}-${who}-${name}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));console.log(`${w} ${who} ${name.padEnd(40)} ${info} problems=${page.problems().length}`);};for (const p of PATHS) {await page.goto(BASE + p, { timeout: 120000 });await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 120000, label: 'hydrated' });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: 15000, label: 'images' }).catch(() => {});await shot(nameOf(p));}// the header's states on the home page (only what the page has: the old header has none of them)await page.goto(BASE + '/', { timeout: 120000 });await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1', { timeout: 120000 });for (const [sel, name] of [['button.menu-toggle', 'state-sidebar'], ['button.search-toggle', 'state-search'], ['button.user-toggle', 'state-usermenu'], ['button.ident-toggle', 'state-identmenu']]) {const there = await page.evaluate(`(() => { const b = document.querySelector(${JSON.stringify(sel)}); return !!b && b.getClientRects().length > 0 && getComputedStyle(b).display !== 'none' })()`);if (!there) continue;await page.click(sel);await shot(name);await page.evaluate(`document.querySelectorAll(':popover-open').forEach(e => e.hidePopover())`);}await page.close();}}} finally { await browser.close(); }
Branches
Latest commits
- 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
- 46a37036records: DP71 liveTracker
- 3bcb7039Status/log: DP71 in progressTracker
- 5b3a5693Log: SR1b merged via PR 2, DP71 startedTracker