gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmaina06fc778Reset virtual-list window when the host changes resetKeyAtlasmain/tests/md-keys-run.mjs

2.5 KB

  1. // tests/md-keys-run.mjs — mission 011: run tests/md-keys.mjs in a REAL Chrome, ONE existing tab (never a new one), real keys only.
  2. // HL_CDP_URL=http://127.0.0.1:9223 MDK_TAB=<target id> MDK_BASE=http://127.0.0.1:8796 [MDK_SHOTS=dir] [MDK_TAG=old|new] node tests/md-keys-run.mjs
  3. // Without HL_CDP_URL it starts its own headless Chrome (debug ports 8797-8799) and opens its own tab, like the gate.
  4. import { writeFileSync, mkdirSync } from 'node:fs';
  5. import { join } from 'node:path';
  6. import { Page, sleep, launchBrowser } from './cdp.mjs';
  7. import { mdKeys } from './md-keys.mjs';
  8. const BASE = process.env.MDK_BASE || 'http://127.0.0.1:' + (process.env.MDK_PORT || 8796);
  9. const SHOTS = process.env.MDK_SHOTS, TAG = process.env.MDK_TAG || 'run';
  10. if (SHOTS) mkdirSync(SHOTS, { recursive: true });
  11. let passes = 0, failures = 0;
  12. const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${ok ? '' : ' — ' + detail}`); if (ok) passes++; else failures++; };
  13. const browser = await launchBrowser({ debugPortRange: (process.env.MDK_CHROME || '8797-8799').split('-').map(Number) });
  14. let page;
  15. const remote = !!process.env.HL_CDP_URL;
  16. if (remote) {
  17. const { sessionId } = await browser.conn.send('Target.attachToTarget', { targetId: process.env.MDK_TAB, flatten: true });
  18. page = new Page(browser, process.env.MDK_TAB, sessionId);
  19. await page._init();
  20. } else page = await browser.newPage();
  21. try {
  22. for (const width of (process.env.MDK_WIDTHS || '390,1280').split(',').map(Number)) {
  23. await page.send('Emulation.setDeviceMetricsOverride', { width, height: width === 390 ? 844 : 900, deviceScaleFactor: 1, mobile: width === 390 });
  24. await page.goto(BASE + '/md-editor');
  25. if (remote) await page.send('Page.bringToFront');
  26. await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1', { timeout: 30000, label: 'hydrated' });
  27. const shot = async (name) => { if (!SHOTS) return; const { data } = await page.send('Page.captureScreenshot', { format: 'png' }); writeFileSync(join(SHOTS, `${TAG}-${width}-${name}.png`), Buffer.from(data, 'base64')); };
  28. await mdKeys(page, { base: BASE, check, sleep, label: String(width), shot });
  29. await shot('end');
  30. }
  31. } catch (e) { check('md-keys ran', false, String(e && e.stack || e)); }
  32. if (remote) { try { await page.send('Emulation.clearDeviceMetricsOverride'); await page.goto('about:blank'); } catch {} browser.conn.close(); }
  33. else await browser.close();
  34. console.log(`${passes} passed, ${failures} failed`);
  35. process.exit(failures ? 1 : 0);

Branches

Latest commits

  • a06fc778Reset virtual-list window when the host changes resetKeyAtlas
  • 3aab598cRe-vendor complete Hybriel day73 set for virtual-list resetAtlas
  • 337ca075MD1 gate check measures frames in the page, not milliseconds from outside, and takes the middle load (components#30)mre
  • f5f131c5Record AP29 autoplay comparisons and passing gatesmre
  • 51c38187Gate media autoplay on first load and after client mountmre
  • a3f2223dRecord successful B44 deployment and live proofmre
  • 06c1e021Record passing B44 browser rerunmre
  • c9861533Record B44 component proof and browser gate blockermre
  • 1b7413beIgnore detached media events and space demo option outputsmre
  • ca3b4959Re-vendor complete Hybriel plugins and runtime to day44mre
  • df9e7df9Last-item checks run in the browser gate (components#26 fixed on day41); media-player loop is a plain Booleanmre
  • 895a5afcRe-vendor complete Hybriel plugins and runtime to day41mre
  • 16006bb3Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 88397fc3Re-vendor complete Hybriel plugins and runtime to day39mre
  • 9b872cedRecord IC28 deployment and live icon verificationmre
  • 46fefaa7Count the icons entry in the offline home-page checkmre
  • c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
  • 5e090ffdRecord IC28 review evidence and gate resultsmre
  • adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
  • c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre