question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests stopped executing after redirect to google login page

See original GitHub issue

Current behavior:

Testing our website which redirects to google login page to authenticate. But the tests stopped executing after the webpage is redirected.

Desired behavior:

The tests should continue executing after redirection.

How to reproduce:

Please run the following test, you will identify the problem after the line of “cy.get(‘#gb_70’) .click()”

describe('Google Map', function () {
  it('.should() - assert that <title> is correct', function () {
    cy.visit('https://www.google.co.uk/maps')
     cy.wait(10000)
    // cy.get('#vasquette').click()
    cy.get('#vasquette').within(() => {
       cy.get('#gb_70') .click()
     })
     cy.wait(10000)
     cy.get('#identifierId')
       .type('xyz@gmail.com').should('have.value', 'xyz@gmail.com')

       cy.get('#identifierNext')
       .click()

       cy.get('#next')
       .click()
  })
})

Test code:

describe('Google Map', function () {
  it('.should() - assert that <title> is correct', function () {
    cy.visit('https://www.google.co.uk/maps')
     cy.wait(10000)
    // cy.get('#vasquette').click()
    cy.get('#vasquette').within(() => {
       cy.get('#gb_70') .click()
     })
     cy.wait(10000)
     cy.get('#identifierId')
       .type('xyz@gmail.com').should('have.value', 'xyz@gmail.com')

       cy.get('#identifierNext')
       .click()

       cy.get('#next')
       .click()
  })
})

Additional Info (images, stack traces, etc)

  • Operating System: Mac OS
  • Cypress Version: Beta Version 2.0.2
  • Browser Version: Chrome 64

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
hdavidzhucommented, Apr 5, 2019

@brian-mann Do you know of a good example of Google’s Oauth implementation in Cypress? I’m looking at https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/logging-in__single-sign-on/cypress/integration/logging-in-single-sign-on-spec.js and am curious how this looks when interacting with Google.

1reaction
chan-devcommented, Jan 1, 2021

@hdavidzhu were you able to find a google oauth2 implementation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ruby on rails - Integration test losing signed in user after redirect
After the test above clicks on the "Sign in" button, a session is created as intended and then the user is redirected to...
Read more >
Create a redirect test - Optimize Resource Hub - Google Support
Open Chrome DevTools. Click on the Network tab. Check the box next to Preserve log. Enter the URL of the redirect experiment in...
Read more >
Authenticate Using Google with JavaScript - Firebase
Before you begin; Handle the sign-in flow with the Firebase SDK; Handling account-exists-with-different-credential Errors. Popup mode; Redirect mode.
Read more >
Web Security - Cypress Documentation
After the first cy.visit() command is issued in a test, Cypress changes its URL to match the origin of your remote application, thereby...
Read more >
After successful login application not redirecting to destination ...
As long as no login validation is done and the Test screen is not anonymous, it will redirect to the login page. 0....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found