tracker
All repositories: gitoria
1.7 KB
// repro for tracker#38: real clicks on the pager, logs URL + first tile + current page after eachimport { launchBrowser, sleep } from './cdp.mjs';const BASE = process.argv[2] || 'https://tracker.worldapi.org';const width = Number(process.argv[3] || 1280);const b = await launchBrowser({ debugPortRange: (process.env.REPRO_CHROME || '8736-8739').split('-').map(Number) });const p = await b.newPage();if (width < 600) await p.send('Emulation.setDeviceMetricsOverride', { width, height: 800, deviceScaleFactor: 2, mobile: true });await p.goto(BASE + '/movies');await sleep(2500);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 })`);console.log('start', await state());for (const step of ['2', '3', 'Next', 'Previous', '10', 'BACK', 'FORWARD']) {if (step === 'BACK') await p.evaluate('history.back()');else if (step === 'FORWARD') await p.evaluate('history.forward()');else {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; })()`);if (!ok) { console.log(step, 'NO BUTTON'); continue; }await p.click('[data-t38]');}await sleep(2500);console.log(step.padEnd(8), await state());}console.log('problems', JSON.stringify(p.problems().slice(0, 5)));await b.close();
Branches
Latest commits
- 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
- 4a802ae7status: RV48 runningmre
- 0a5412b6RV48 brief, day48 outmre
- 56665efelog: CB69 mergedmre
- 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
- e55b379dKeep shared app title independent of the route import graphmre
- 9a99659blog: hybriel#334, batch waits for day48mre
- 85fa6c9blog: CB68 result, CB69 startedmre
- 2f07c1b7log: DP68 boot gate failed, CB68mre
- 9652782dlog: HM59 merged, DP68 startedmre
- 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
- f7bfe90bMove remaining page builders into their topicsmre
- 7c3991f9log: day46 from Antonmre
- ec54fc35Move show page logic into the shows topicmre
- c1a8d074log: correct timesmre
- 5827eba9log: HM57 merged, HM59 startedmre
- d1a91be9Merge hm57-let: tracker#57 let only for reassigned namesmre
- a404ed75Report HM57 audit, gates and integration notesmre
- 1dcb87a7Use plain declarations for unchanged bindingsmre
- b90395e3log: HM51 mergedmre