gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6a6d71ea6a6d71eaLog: gitoria membershipmre6a6d71ea/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

  • 6a6d71eaLog: gitoria membershipmre
  • 8b842dc8Log + CONDUCTOR: gitoria PR switch-onmre
  • 6bb7c20estatus: window 2026-11-09mre
  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre