gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb8bd1157b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mreb8bd1157/tests/realdata-check.mjs

4.6 KB

  1. // tests/realdata-check.mjs — mission 047 REAL-DATA check (NOT part of the gate): a dev server on :8730 over a COPY of Byrodin's
  2. // storage/, a session file for the creator (az5b2) whose id is in .scratch/real-sid (STATUS.md has the procedure). Times
  3. // / , /my/* and the first followed show (direct + CLIENT-SIDE from /my/shows), expands/collapses a season, checks every
  4. // check svg is a drawn SVG, screenshots 390 + 1280 into /tmp/w047/real/. Run: node tests/realdata-check.mjs
  5. import { writeFileSync, readFileSync } from 'node:fs';
  6. import { launchBrowser } from '../tests/cdp.mjs';
  7. process.env.HL_CHROME ||= '/opt/google/chrome/chrome';
  8. const BASE = 'http://127.0.0.1:8730', OUT = '/tmp/w047/real', SID = readFileSync('.scratch/real-sid', 'utf8').trim();
  9. const browser = await launchBrowser({ debugPortRange: [8731, 8731] });
  10. const page = await browser.newPage();
  11. const ev = (e) => page.evaluate(e);
  12. await page.send('Network.enable', {});
  13. await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });
  14. const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 30000, label: 'hydrated' });
  15. const shot = async (n) => writeFileSync(`${OUT}/${n}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));
  16. const svgState = () => ev(`JSON.stringify((() => { const s = Array.from(document.querySelectorAll('button.checkicon svg, season-caret svg'));
  17. return { checks: document.querySelectorAll('button.checkicon').length, badNs: s.filter(e => e.namespaceURI !== 'http://www.w3.org/2000/svg').length,
  18. undrawn: Array.from(document.querySelectorAll('button.checkicon svg circle')).filter(c => !(c.getBoundingClientRect().width > 0)).length }; })())`);
  19. const res = [];
  20. for (const [w, h, mobile] of [[390, 844, true], [1280, 900, false]]) {
  21. await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: mobile ? 2 : 1, mobile });
  22. let showPath = null;
  23. for (const [name, path] of [['home', '/'], ['my-shows', '/my/shows'], ['my-unwatched', '/my/unwatched'], ['my-schedule', '/my/schedule']]) {
  24. const t = Date.now();
  25. await page.goto(BASE + path, { timeout: 60000 });
  26. await hydrated();
  27. if (name === 'my-shows') await page.waitFor(`Array.from(document.querySelectorAll('img.myshow-poster')).every(i => i.complete)`, { timeout: 30000 });
  28. const ms = Date.now() - t;
  29. const info = await ev(`JSON.stringify({ rows: document.querySelectorAll('my-show-row, unwatched-row, schedule-row').length, user: !!document.querySelector('#logout'), scrollW: document.documentElement.scrollWidth, headerH: document.querySelector('application-header').getBoundingClientRect().height })`);
  30. res.push(`${w} ${path} ${ms} ms ${info}`);
  31. await shot(`${name}-${w}`);
  32. if (name === 'my-shows') showPath = await ev(`document.querySelector('a.myshow-title').getAttribute('href')`);
  33. }
  34. // direct load of that show
  35. let t = Date.now();
  36. await page.goto(BASE + showPath); await hydrated();
  37. res.push(`${w} ${showPath} (direct) ${Date.now() - t} ms ${await svgState()}`);
  38. await shot(`show-direct-${w}`);
  39. // CLIENT-SIDE: /my/shows → click the first title
  40. await page.goto(BASE + '/my/shows'); await hydrated();
  41. await ev(`window.__w047 = 'same document'`);
  42. t = Date.now();
  43. await page.click('a.myshow-title');
  44. await page.waitFor(`location.pathname === ${JSON.stringify(showPath)} && !!document.querySelector('button.checkicon svg circle')`, { timeout: 20000, label: 'client nav' });
  45. res.push(`${w} client-side nav → ${showPath} ${Date.now() - t} ms marker=${await ev('window.__w047')} ${await svgState()}`);
  46. await shot(`show-clientnav-${w}`);
  47. // expand the first collapsed season, then collapse it again
  48. const sid = await ev(`(() => { const r = document.querySelector('season-row.collapsed button.season-toggle'); return r ? r.value : null })()`);
  49. if (sid) {
  50. await page.click(`button.season-toggle[value="${sid}"]`);
  51. await page.waitFor(`document.querySelector('button.season-toggle[value="${sid}"]').closest('season-row').classList.contains('expanded')`, { timeout: 20000 });
  52. res.push(`${w} after expand ${await svgState()}`);
  53. await shot(`show-expanded-${w}`);
  54. await page.click(`button.season-toggle[value="${sid}"]`);
  55. await page.waitFor(`document.querySelector('button.season-toggle[value="${sid}"]').closest('season-row').classList.contains('collapsed')`, { timeout: 20000 });
  56. res.push(`${w} after collapse ${await svgState()}`);
  57. }
  58. }
  59. console.log(res.join('\n'));
  60. console.log('problems', JSON.stringify(page.problems ? page.problems() : []));
  61. await browser.close();

Branches

Latest commits

  • b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
  • 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
  • cbdc4ea7tracker#12: link icons TMDB/IMDb/TVDB/TVmaze; sync fills missing ids (TVmaze lookup); movies fetched via /movie/mre
  • b105bcd8tracker#11: Hybriel master ff51cf46 (checks no longer vanish), mobile-first styles, carets, follow button, sign-in modal, inverted check, orange castmre
  • 31b758aatracker#10: installable app (manifest, service worker, offline shell), own icon + faviconmre
  • 2fa9d997tracker#9: TMDB sync (followed shows: seasons, episodes, posters), tools/sync-tmdb.hl + daily run 04:00 UTC, fake TMDB in gatemre
  • 49e1f61edeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • 54070a4etracker#8: /my/unwatched + /my/schedule (301 from old), S01E01, title (year), 1 episode, watched-set lookup (unwatched 15s -> 1s)mre
  • 3251488atracker#7: /my/shows (followed shows, newest follow first, poster, title, last watched SxxEyy); gate can take screenshots (TRACKER_GATE_SHOTS)mre
  • 44b7d9f9tracker#6: /schedule — upcoming episodes of followed shows, soonest firstmre
  • 91c9fc8ctracker#5: /unwatched — unwatched released episodes of followed shows, newest firstmre
  • a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmre
  • 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
  • 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
  • 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre
  • 2ad9d29ctracker#1: login exactly like calendar (identity selector in the header, empty homepage)mre
  • 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre