components
All repositories: gitoria
2.5 KB
// 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.// 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// Without HL_CDP_URL it starts its own headless Chrome (debug ports 8797-8799) and opens its own tab, like the gate.import { writeFileSync, mkdirSync } from 'node:fs';import { join } from 'node:path';import { Page, sleep, launchBrowser } from './cdp.mjs';import { mdKeys } from './md-keys.mjs';const BASE = process.env.MDK_BASE || 'http://127.0.0.1:' + (process.env.MDK_PORT || 8796);const SHOTS = process.env.MDK_SHOTS, TAG = process.env.MDK_TAG || 'run';if (SHOTS) mkdirSync(SHOTS, { recursive: true });let passes = 0, failures = 0;const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${ok ? '' : ' — ' + detail}`); if (ok) passes++; else failures++; };const browser = await launchBrowser({ debugPortRange: (process.env.MDK_CHROME || '8797-8799').split('-').map(Number) });let page;const remote = !!process.env.HL_CDP_URL;if (remote) {const { sessionId } = await browser.conn.send('Target.attachToTarget', { targetId: process.env.MDK_TAB, flatten: true });page = new Page(browser, process.env.MDK_TAB, sessionId);await page._init();} else page = await browser.newPage();try {for (const width of (process.env.MDK_WIDTHS || '390,1280').split(',').map(Number)) {await page.send('Emulation.setDeviceMetricsOverride', { width, height: width === 390 ? 844 : 900, deviceScaleFactor: 1, mobile: width === 390 });await page.goto(BASE + '/md-editor');if (remote) await page.send('Page.bringToFront');await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1', { timeout: 30000, label: 'hydrated' });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')); };await mdKeys(page, { base: BASE, check, sleep, label: String(width), shot });await shot('end');}} catch (e) { check('md-keys ran', false, String(e && e.stack || e)); }if (remote) { try { await page.send('Emulation.clearDeviceMetricsOverride'); await page.goto('about:blank'); } catch {} browser.conn.close(); }else await browser.close();console.log(`${passes} passed, ${failures} failed`);process.exit(failures ? 1 : 0);
Branches
- b27b
- mainmain branch
- vl27-resetkey
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