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
- 4b59c03dHM50 mission: doc pathmre
- ed526d67HM50 missionmre
- 2f986ca3Log: RT50 passmre
- 1c4715a4RT50 mission: day50 repro retestmre
- 57d1c0dcLog: day50 retest requestmre
- 60b1f419Log: Anton #336 result, wake checkmre
- 919a18aalog: scratchmre
- 6b504440status tidymre
- 9332bd10log: DP70 livemre
- be11daa0DP70 brief fixmre
- 886a7028DP70 brief, HM67 mergedmre
- b41cdd6dMerge hm67-searchids: packed search IDsmre
- 385904eaReport HM67 matched heap measurements and gate proofmre
- e5c9b659Pack retained search IDs into UTF-8 bytesmre
- 62a5f6c7HM67 brief, HM66 mergedmre
- b32b8440Merge hm66-catalogindex: packed catalog indexmre
- 2db0f7adReport HM66 heap measurements and validationmre
- 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
- 71134e21HM66 briefmre
- ed4cbab2status timemre