Search code examples
jestjse2e-testingwebautomationplaywright

Can't perform Social Sign in with google in playwright as google prevents it. Is there a way around using Playwright? I'm using Chromium


In the following code I'm trying to login in with sign in with google button but after entering email and clicking next it takes me to error screen, which I have attached it as picture

it('Sign Up With Google ', async() => {
    await page.waitForSelector(signUpWithGoogle, { state: 'visible' });
    await page.click(signUpWithGoogle);
    await page.click(signUpWithGoogle);
    const [popup] = await Promise.all([
       page.waitForEvent('popup'),
       page.click(signUpWithGoogle),
       page.click(signUpWithGoogle)
    ])
    await popup.fill('//input[@type="email"]', googleEmail);
    await popup.click('//span[text()="Next"]');
    await popup.waitForTimeout(10000);
    await page.waitForTimeout(2000);
}, timeforSigninWithGoogle)

enter image description here


Solution

  • So Apparently those google accounts which have 2F authentication enabled will not be signed in and will give you above error in chromium but those accounts which doesn't have 2F authentication will worked on both webkit and chromium