MCPcopy Index your code
hub / github.com/MALSync/MALSync / loopEl

Function loopEl

test/headless/test.js:547–567  ·  view source on GitHub ↗
(testPage, headless = true)

Source from the content-addressed store, hash-verified

545}
546
547async function loopEl(testPage, headless = true) {
548 if (OnlyPage && testPage.title !== OnlyPage) return;
549 if (!testPage.enabled && typeof testPage.enabled !== 'undefined') return;
550 const b = await getBrowser(headless);
551
552 try {
553 await testPageCase(testPage.title, testPage, b);
554 } catch (e) {
555 if (e === 'Captcha') {
556 if (!process.env.CI && headless === true) {
557 await loopEl(testPage, false);
558 } else {
559 printLogBlock(testPage.title);
560 }
561 } else if (e === 'Blocked') {
562 printLogBlock(testPage.title);
563 } else {
564 console.error(e);
565 }
566 }
567}
568
569async function openPage(b) {
570 const page = await b.newPage();

Callers 1

mainFunction · 0.85

Calls 4

getBrowserFunction · 0.85
testPageCaseFunction · 0.85
printLogBlockFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected