munHunger
munHunger

Reputation: 2999

Cypress not catching XHR request

I have made a simple cypress test and I want to start mocking the responses.

So in my beforeEach method I have the following

    cy.server()
    cy.route({
        method: "POST",
        url: "/perf/performance/track",
        status: 200,
        response: {}
    });

However it is not being triggered. The cypress UI displays the route as stubbed but not hit.

However I do see this in the console, which I find odd since it means that cypress knows about the call, right=

POST /perf/performance/track 503 32.261 ms - -

So any ideas of what the issue might be or where to start looking?

Just realized that even though it is shown in the cypress console, it is not being displayed withing the cypress GUI

Upvotes: 0

Views: 1050

Answers (1)

TetianaMalva
TetianaMalva

Reputation: 39

@munHunter Have you tried to investigate why do you have 503 error?

I wrote your test with my URL and it works fine.

Upvotes: 1

Related Questions