eg: fix page.type: text: expected string, got number

This commit is contained in:
Ralf Vogler 2022-10-21 00:47:36 +02:00
parent e931892b76
commit 746d226cf6

View file

@ -83,7 +83,7 @@ try {
await page.waitForNavigation({ url: '**/id/login/mfa**'}).then(async () => { await page.waitForNavigation({ url: '**/id/login/mfa**'}).then(async () => {
console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...');
const otp = await prompt({type: 'number', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!'}); const otp = await prompt({type: 'number', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!'});
await page.type('input[name="code-input-0"]', otp); await page.type('input[name="code-input-0"]', otp.toString());
await page.click('button[type="submit"]'); await page.click('button[type="submit"]');
}); });
} }