gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit641f3b54641f3b54Tracker: Apollo answermre641f3b54/tests/realdata-018.mjs

2.1 KB

  1. // tests/realdata-018.mjs — tracker.worldapi.org#18, NOT the gate: titles the daily delta run refreshed, on a COPY of live storage/
  2. // (STATUS.md "ticket #18"). Per title in REAL_TITLES and width (390, 1280): full page load, the header as shown (title, tagline,
  3. // summary start), a screenshot to $REAL_OUT.
  4. // Env: REAL_PORT (8750), REAL_CHROME (8757-8759), REAL_OUT (/tmp/w067/real), REAL_TITLES ('Star-Wars-Andor,Breaking-Bad').
  5. import { writeFileSync, mkdirSync } from 'node:fs';
  6. import { launchBrowser } from './cdp.mjs';
  7. process.env.HL_CHROME ||= '/opt/google/chrome/chrome';
  8. const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8750}`, OUT = process.env.REAL_OUT || '/tmp/w067/real';
  9. mkdirSync(OUT, { recursive: true });
  10. const [CH_FROM, CH_TO] = (process.env.REAL_CHROME || '8757-8759').split('-').map(Number);
  11. const TITLES = (process.env.REAL_TITLES || 'Star-Wars-Andor,Breaking-Bad').split(',').filter(Boolean);
  12. const browser = await launchBrowser({ debugPortRange: [CH_FROM, CH_TO || CH_FROM] });
  13. const page = await browser.newPage();
  14. const ev = (e) => page.evaluate(e);
  15. const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 30000, label: 'hydrated' });
  16. for (const slug of TITLES) {
  17. for (const w of [390, 1280]) {
  18. const mobile = w < 600;
  19. await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: mobile ? 844 : 900, deviceScaleFactor: mobile ? 2 : 1, mobile });
  20. const t0 = Date.now();
  21. await page.goto(BASE + '/shows/' + slug); await hydrated();
  22. const load = Date.now() - t0;
  23. const head = await ev(`JSON.stringify({ h1: (document.querySelector('show-header h1') || {}).textContent || null, summary: ((document.querySelector('show-summary') || {}).textContent || '').slice(0, 120), scrollW: document.documentElement.scrollWidth })`);
  24. writeFileSync(`${OUT}/${slug}-${w}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));
  25. console.log(`${slug} @${w}: full load ${load} ms ${head}`);
  26. }
  27. }
  28. console.log('problems', JSON.stringify(page.problems()));
  29. await browser.close();

Branches

Latest commits

  • 641f3b54Tracker: Apollo answermre
  • 8b3cbddaTracker: status, TR7 fix livemre
  • ec30162aTracker: TR7 fix livemre
  • 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
  • 3e164b63Tracker: status after CL1mre
  • 9d686bb3Tracker: CL1 reviewedmre
  • b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
  • 298785f2Tracker: CL1 startedmre
  • 36b22710Tracker: port slot, CL1 briefmre
  • a401190fTracker: GO for the crash loopmre
  • e195d372Tracker: token pathsmre
  • 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
  • 8dd423f7README: login.js stays by caramboleyo's explicit rulemre
  • d8df1493tracker: standby service on port 45018 and a gap-free hand-over in deploy.sh step 4mre
  • 36dd1686ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • ff9b838etracker: the Ended status pill uses the same red as layouts (pill danger); gate updatedmre
  • 40d9719eTP2: LOG line and report for the tracker pillsmre
  • ab3f2ba5tracker: status, genres, TMDB/IMDb/TVDB/TVmaze links and list kinds use the theme's pill; dense season list with the season check centred on its title line; gates for bothmre
  • 521061d6tracker header on phones: signed in, the brand fits whole at 360 and 390 px (tighter gaps and side paddings, slightly smaller brand, narrow screens and signed in only); mobile gate checks itmre
  • 18114a53tracker: franchises gate waits for the signed-out selector instead of the removed Log in buttonmre