gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc545b642c545b642content-first: nest child and compound selectors in Stylemrec545b642/tests/e2e-md-showcase.mjs

2.5 KB

  1. // tests/e2e-md-showcase.mjs — mission 010: tests/md-showcase.mjs in lisbeth's real Chrome, ONE existing page tab (picked fresh from /json),
  2. // real keys only, never /json/new, never the clipboard. Run under the lock:
  3. // timeout 600 flock /media/STORAGE/claude-scratch/atlas/lisbeth.lock env HL_CDP_URL=http://127.0.0.1:9223 MDK_BASE=http://127.0.0.1:<port> [MDK_SHOTS=dir MDK_TAG=old|new] node tests/e2e-md-showcase.mjs
  4. // (needs ssh -L 9223 to lisbeth and a reverse -R <port> from lisbeth to the app). The tab is left at about:blank.
  5. import { writeFileSync, mkdirSync } from 'node:fs';
  6. import { join } from 'node:path';
  7. import { Page, sleep, launchBrowser } from './cdp.mjs';
  8. import { mdShowcase } from './md-showcase.mjs';
  9. const BASE = process.env.MDK_BASE, 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 = (l, ok, d = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${l}${ok ? '' : ' — ' + d}`); if (ok) passes++; else failures++; };
  13. const tabs = (await (await fetch(process.env.HL_CDP_URL + '/json')).json()).filter(t => t.type === 'page');
  14. const tab = tabs.find(t => t.url === 'about:blank') || tabs[0];
  15. if (!tab) { console.log('no page tab'); process.exit(2); }
  16. console.log('tab', tab.id, tab.url);
  17. const browser = await launchBrowser({ debugPortRange: (process.env.LAYOUTS_GATE_CHROME_MD || '8777-8779').split('-').map(Number) });
  18. const { sessionId } = await browser.conn.send('Target.attachToTarget', { targetId: tab.id, flatten: true });
  19. const page = new Page(browser, tab.id, sessionId); await page._init();
  20. try {
  21. for (const width of [390, 1280]) {
  22. await page.send('Emulation.setDeviceMetricsOverride', { width, height: width === 390 ? 844 : 900, deviceScaleFactor: 1, mobile: width === 390 });
  23. await page.goto(BASE + '/components/md-editor');
  24. await page.send('Page.bringToFront');
  25. await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1', { timeout: 30000, label: 'hydrated' });
  26. const shot = async (n) => { if (!SHOTS) return; const { data } = await page.send('Page.captureScreenshot', { format: 'png' }); writeFileSync(join(SHOTS, `${TAG}-${width}-${n}.png`), Buffer.from(data, 'base64')); };
  27. await mdShowcase(page, { check, sleep, label: String(width), shot });
  28. }
  29. } catch (e) { check('e2e ran', false, String(e && e.stack || e)); }
  30. try { await page.send('Emulation.clearDeviceMetricsOverride'); await page.goto('about:blank'); } catch {}
  31. browser.conn.close();
  32. console.log(`${passes} passed, ${failures} failed`);
  33. process.exit(failures ? 1 : 0);

Branches

Latest commits

  • c545b642content-first: nest child and compound selectors in Stylemre
  • eae2be7aapp-sidebar: nest child selectors and document caller-slot gapmre
  • 69c9f784Record LY7 slot nesting blocker and minimal repromre
  • b1d4f379app-header: nest child and compound selectors in Stylemre
  • 6385ff8eRecord LY7 style formatting proof and review statusmre
  • 0100f51etracker-demo: format Style with nested rules and bare mediamre
  • 5f82554enotes-demo: format Style with nested rules and bare mediamre
  • 3dc27d78mail-demo: format Style with nested rules and bare mediamre
  • cf9648afhome: format Style with nested rules and bare mediamre
  • 846a6242user-menu: format Style with nested rules and bare mediamre
  • 4d58708cthree-pane: format Style with nested rules and bare mediamre
  • 0bbfc553main-menu: format Style with nested rules and bare mediamre
  • 7755199dlist-first: format Style with nested rules and bare mediamre
  • 35199303content-first: format Style with nested rules and bare mediamre
  • 00f6e698app-sidebar: format Style with nested rules and bare mediamre
  • bb2f29c9app-header: format Style with nested rules and bare mediamre
  • 3aca2d7fSync components from 8176eb1 with reviewed nested stylesmre
  • 87e4003dRe-vendor layouts to Hybriel set day35mre
  • d8628cfflayouts: a startup error prints its message before exit 1 (hybriel#247)mre
  • 180fd76elayouts: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows; empty Table-button table; tickets#49, notes#5)mre