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.

Cypress did not catch all XHR requests: No request ever occurred

See original GitHub issue

Current behavior:

if we are calling some XHR request on the end of the test then it will pass, but if we want to catch XHR request on page load it’s not working…

example: screen shot 2018-07-21 at 14 44 04

describe('Help Page', () => {
  it('visit /help', () => {
    const USER = Cypress.env('username');
    const PASS = Cypress.env('userpass');
    cy.visit('/');

    cy.server();
    cy.route('POST', '**login').as('auth');

    cy.get('input[name=username]').type(USER);
    cy.get('input[name=password]').type(PASS);
    cy.get('button[type=submit]').click();

    cy.wait('@auth');

Versions

latest cypress version 3.0.2

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jennifer-shehanecommented, Apr 24, 2019

Closing, some have mentioned resolving their issues after providing a reproducible example while others have not provided a reproducible example.

Please open a new issue with a fully reproducible example if you are experiencing a related issue that appears to be a bug in Cypress. We can’t do anything without understanding the complete picture and seeing the problem ourselves.

2reactions
bretepcommented, Feb 14, 2019

I ended up adding a cy.wait(500) since the XHR is too fast for the cy.wait('@postAPI') to catch. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress intercept - No request ever occurred - Stack Overflow
I have tried the following with no luck. Someone please help me to find out where and what am I missing here as...
Read more >
Cypress cy.intercept Problems - Gleb Bahmutov
Cypress shows XHR calls by default in its Command Log, thus it has nothing to do with our intercept. I always thought NOT...
Read more >
Network Requests - Cypress Documentation
Since no responses are stubbed, that means your server has to actually send real responses. This can be problematic because you may have...
Read more >
cypress-io/cypress - Gitter
Yeah you should not have had to. ... Hi all, I have a search modal which is populated via Ajax. ... But Cypress...
Read more >
XHR requests are cancelled in Cypress - SQA Stack Exchange
It seems you want to wait until routes resolve. If that is the case, you need to explicitly tell Cypress to do just...
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