Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
How do I use Cypress Origin with google accounts?

I am attempting to access a google service embedded into my website which uses accounts.google.com for the login.

I'm trying to use the session/origin commands to do this, but it's failing as if I'm doing nothing at all. I use this with success to login to my application (non google login), but google seems to require something more. I have spent a great deal of time browsing for answers with no luck

Code leading up to login:

cy.get('div [class="active carousel-item"]').find('button').first().click()
cy.loginGoogle(Cypress.env("GoogleUsername"),Cypress.env("GooglePassword"))

Login code:

Cypress.Commands.add('loginGoogle', (username, password) => {
const args = { username, password }

cy.session(args, () =>

{
 cy.origin('https://accounts.google.com', { args }, ({ username, password }) => {
  cy.visit('https://accounts.google.com/')
  cy.get('input[type="email"]').type(username)
  cy.get('div[id="identifierNext"]').find('button').click()
  cy.get('#login-password').type(password)
  cy.get('#btn-login').click()
})
cy.visit('/')
cy.url().should('contain', 'mydomain.com')
})
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to use programmatic authentication as it's suggested in the documentation.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!