Currently, Cypress is not letting me login using the Google Docs login form. It displays an error on the page with no additional message, not even showing me as a bot. We have a Google Add-on that we want to test, and for this we need to login to Google Docs, I already know about the API based authentication for specific apps but I don't need a token, I need to login to Google. I have tried several things, including passing my Chrome profile as --user-data-dir and preserving its cookies (didn't work), and also to login using docs.google.form sign in form. as soon as you hit next on this form, it breaks with a generic error message. I also tried setting the user agent, and using another browser like Edge .
Here is some test code and configuration in the hopes taht it might help.
module.exports = defineConfig({
"chromeWebSecurity": false,
e2e: {
"chromeWebSecurity": false,
baseUrl: 'https://docs.google.com',
experimentalSessionAndOrigin: true,
}
})
// Test code
describe('empty spec', () => {
it('opens the google test document', () => {
cy.visit('/', {
headers: {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36',
}
});
googleLoginPage.getEmailAddressField().type(Cypress.env('googleUser'));
googleLoginPage.getNextButton().click()
})
})
class GoogleLogin {
getEmailAddressField() {
return cy.get('#identifierId');
}
getNextButton() {
return cy.get('#identifierNext');
}
}
export default GoogleLogin;
I am using Cypress 10.3.1.
Hope you guys can help because I'm a bit lost, I know it is not recommended to test Google login etc etc but it is a Google Add-on I'm testing, I can't do API based login if I want to login to a google service itself.