0

I’m trying to automate social login to Google.

`export const loginToGoogle = () => {
loginPageLocatorManager.getContinueWithGmailButton().click();

  const googe_auth_url = Cypress.config().socialAuth.googleAuthURL;
  const google_client_id = Cypress.config().socialAuth.googleAuthClientID;
  const options = {
    redirect_uri: `${origin}/authorizeResult`,
    client_id: google_client_id,
    access_type: 'offline',
    response_type: 'code',
    prompt: 'consent',
    scope: [
      'https://www.googleapis.com/auth/userinfo.profile',
      'https://www.googleapis.com/auth/userinfo.email',
    ].join(' '),
    state: 'google',
  };

  const qs = new URLSearchParams(options);
  const url = `${googe_auth_url}?${qs.toString()}`;

  cy.origin(googe_auth_url, { args: url }, (url) => {
    const google_password = Cypress.config().socialAuth.googlePassword;
    const google_email = Cypress.config().socialAuth.googleEmail;
    cy.visit(url);
    cy.get('input[type="email"]').type(google_email).type('{enter}').wait(3000);

    // Google Login Redirection: Password Input
    cy.get('input[type="password"]')
      .type(google_password)
      .type('{enter}')
      .wait(3000);
  });
};`

I’m getting the following error: Cannot set property message of [object DOMException] which has only a getter Maybe you have any idea of what’s going on here and how to just type credentials? This error occurs before the scripts start typing password.

I tried to use this module: https://github.com/lirantal/cypress-social-logins but the result is the same

Ale Ame
  • 1
  • 1

0 Answers0