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.

AUT navigates to Cypress runner upon page navigation.

See original GitHub issue

Use Cypress version 4.5.0 to reproduce. Later versions are currently blocked by(https://github.com/cypress-io/cypress/issues/7518)

This simple tests consists of:

  • Logging in
  • Visiting specific page with a form
  • Filing out required fields and submitting

Upon submission of the form, a page redirect happens and a series of uncaught errors fire. However, when the form is cancelled, the page redirect still happens, but without the errors.

Here’s the code for both scenarios. The one where the error happens by submitting the form, and the one where everything is ok when canceling the form

it('Example With Errors',() => {
    cy.request('POST', '/Auth/Login', { username: 'cydemoadmin', password: 'Test1@#$%' })
    cy.visit('/#/Settings/business-units/Add')
    cy.get('[type=submit]').should('be.visible')

    cy.get('[name=Name]').type('TestBU8') //Change value after one use. You can just increase number
    cy.get('[name=OfficialName]').type('TestBU8') //Change value after one use. You can just increase number
    cy.get('[name=Email]').type('asdf2sdfsdf@ggmaill.com')
    cy.get('[name=PhoneNumber]').type('8185556767')
    cy.get('[type=submit]').click()
  })

  it('Example Without Errors',() => {
    cy.request('POST', '/Auth/Login', { username: 'cydemoadmin', password: 'Test1@#$%' })
    cy.visit('/#/Settings/business-units/Add')
    cy.get('[type=submit]').should('be.visible')
    cy.get('.btn-link.muted').click()
  })

Here’s the stack trace exception noException

There seems to be a weird URL mutation happening for the scenario where the exceptions happen

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
csalazar1commented, Jun 1, 2020

@jennifer-shehane I think it’s because you ran both tests. There’s no after You just need to run only the it() with the error. If you run both it()'s it’ll move on the second test before the first one has finished loading the page and therefore the errors.

Nevertheless, I tried "experimentalSourceRewriting": true on 4.7.0 and got a different error. The page was never able to launch so the test never reached it 2 1

Just make sure to it.only() the Example With Errors test and change values of TestBU{##} to some random name that hasn’t been used like test43823. You should see the URL mutation happen in an after() even though there is none specified in the spec file

0reactions
jennifer-shehanecommented, Apr 8, 2022

This is no longer reproducible from the given repro.

Since this issue hasn’t had activity in a while, we’ll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we’d be happy to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When Can The Test Navigate? - Cypress
The test runner still has the reference to the "Users" navigation <a> element - but that element is no longer in the current...
Read more >
How to detach Cypress test runner from a page?
I'm trying to use Cypress with a site that redirects users to a third-party site for authentication. Once a user logs in, they're...
Read more >
Implementing navigation requests | End-to-End Web Testing ...
We use cy.visit() in Cypress to navigate to a remote page of the application under test. By using this command, we can also...
Read more >
How to perform Cypress Test Automation | BrowserStack
A step-by-step tutorial on setting up and running automated Cypress test ... Navigate to cypress/integration/specs > create a file with name ...
Read more >
Cypress Tips and Tricks - Gleb Bahmutov
Read the docs Run Cypress on your own CI Record success and. ... Getting the pathname after the page navigation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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