Fix eslint no-empty and clean tests
This commit is contained in:
parent
5f919039ab
commit
3fd861f134
4 changed files with 48 additions and 17 deletions
|
|
@ -64,7 +64,9 @@ try {
|
|||
await page.waitForSelector('#h_captcha_challenge_login_prod iframe', { timeout: 15000 });
|
||||
console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.');
|
||||
notify('unrealengine: got captcha during login. Please check.');
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
})();
|
||||
void (async () => {
|
||||
try {
|
||||
|
|
@ -73,7 +75,9 @@ try {
|
|||
const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them
|
||||
await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString());
|
||||
await page.click('button[type="submit"]');
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
})();
|
||||
} else {
|
||||
console.log('Waiting for you to login in the browser.');
|
||||
|
|
@ -143,7 +147,9 @@ try {
|
|||
await page.locator('[name=accept-label]').check({ timeout: 10000 });
|
||||
console.log('Accept End User License Agreement');
|
||||
await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies'
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
})();
|
||||
await page.waitForSelector('#webPurchaseContainer iframe');
|
||||
const iframe = page.frameLocator('#webPurchaseContainer iframe');
|
||||
|
|
@ -164,7 +170,9 @@ try {
|
|||
try {
|
||||
await btnAgree.waitFor({ timeout: 10000 });
|
||||
await btnAgree.click();
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
})(); // EU: wait for and click 'I Agree'
|
||||
try {
|
||||
// context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s?
|
||||
|
|
@ -173,7 +181,9 @@ try {
|
|||
try {
|
||||
await captcha.waitFor({ timeout: 10000 });
|
||||
console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.');
|
||||
} catch {}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
})(); // may time out if not shown
|
||||
await page.waitForSelector('text=Thank you');
|
||||
for (const id of ids) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue