PW: replace deprecated type() with pressSequentially() for OTPs

This commit is contained in:
Ralf Vogler 2023-09-18 14:02:15 +02:00
parent 840d35c2d2
commit 41f1f95509
4 changed files with 5 additions and 5 deletions

2
gog.js
View file

@ -61,7 +61,7 @@ try {
console.log('Two-Step Verification - Enter security code');
console.log(await iframe.locator('.form__description').innerText())
const otp = await prompt({type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 4 || 'The code must be 4 digits!'}); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them
await iframe.locator('#second_step_authentication_token_letter_1').type(otp.toString(), {delay: 10});
await iframe.locator('#second_step_authentication_token_letter_1').pressSequentially(otp.toString(), {delay: 10});
await iframe.locator('#second_step_authentication_send').click();
await page.waitForTimeout(1000); // TODO still needed with wait for username below?
}).catch(_ => { });