gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc7cdef62c7cdef62Log: Apollo STOP, workers pausedmrec7cdef62/tests/repro-t38.mjs

1.7 KB

  1. // repro for tracker#38: real clicks on the pager, logs URL + first tile + current page after each
  2. import { launchBrowser, sleep } from './cdp.mjs';
  3. const BASE = process.argv[2] || 'https://tracker.worldapi.org';
  4. const width = Number(process.argv[3] || 1280);
  5. const b = await launchBrowser({ debugPortRange: (process.env.REPRO_CHROME || '8736-8739').split('-').map(Number) });
  6. const p = await b.newPage();
  7. if (width < 600) await p.send('Emulation.setDeviceMetricsOverride', { width, height: 800, deviceScaleFactor: 2, mobile: true });
  8. await p.goto(BASE + '/movies');
  9. await sleep(2500);
  10. const state = () => p.evaluate(`JSON.stringify({ url: location.pathname, first: (document.querySelector('a.tile tile-title')||{}).textContent, cur: (document.querySelector('pagination li.current')||{}).textContent, items: Array.from(document.querySelectorAll('pagination li')).map(l=>l.textContent.trim()).join(' '), n: document.querySelectorAll('pagination').length })`);
  11. console.log('start', await state());
  12. for (const step of ['2', '3', 'Next', 'Previous', '10', 'BACK', 'FORWARD']) {
  13. if (step === 'BACK') await p.evaluate('history.back()');
  14. else if (step === 'FORWARD') await p.evaluate('history.forward()');
  15. else {
  16. const ok = await p.evaluate(`(() => { document.querySelectorAll('[data-t38]').forEach(e => e.removeAttribute('data-t38')); const bt = Array.from(document.querySelectorAll('pagination button')).find(b => b.textContent.trim() === ${JSON.stringify(step)}); if (!bt) return false; bt.setAttribute('data-t38', '1'); return true; })()`);
  17. if (!ok) { console.log(step, 'NO BUTTON'); continue; }
  18. await p.click('[data-t38]');
  19. }
  20. await sleep(2500);
  21. console.log(step.padEnd(8), await state());
  22. }
  23. console.log('problems', JSON.stringify(p.problems().slice(0, 5)));
  24. await b.close();

Branches

Latest commits

  • 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
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre
  • 6d05fa37Log: HM50 Part A mergedmre
  • 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
  • e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
  • 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
  • 2f391aa9Log: HM50 startedmre
  • 4b59c03dHM50 mission: doc pathmre