Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the last record in the Command Log is a canceled or aborted XHR the test shows failure #14978

Closed
bahmutov opened this issue Feb 8, 2021 · 6 comments · Fixed by #15037
Closed
Assignees
Labels
pkg/reporter This is due to an issue in the packages/reporter directory type: regression A bug that didn't appear until a specific Cy version release v6.4.0 🐛 Issue present since 6.4.0

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Feb 8, 2021

Cypress v6.4.0

Look at the image below: 6 passing tests, no failures, BUT the last test shows the failure icon. I think this happens when the last command in that test is an aborted XHR request

Screen Shot 2021-02-08 at 2 39 59 PM

Reproduction

Clone https://github.com/bahmutov/ceceliacreates-nuxt/tree/problem branch problem

git checkout problem
npm install
npm run local

Click on the spec

Notice how this movie shows the status of the test keeps toggling depending on the XHR logs

failing-test-demo.mp4

At the end, the passing test becomes red again after a few more XHRs were cancelled

@bahmutov bahmutov added pkg/reporter This is due to an issue in the packages/reporter directory type: bug labels Feb 8, 2021
@jennifer-shehane
Copy link
Member

Could you provide a reproducible example please? 😄

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Feb 9, 2021
@bahmutov
Copy link
Contributor Author

bahmutov commented Feb 9, 2021

Yeah, I will add instructions for reproduction, but want to note that a user also reported same problem here

https://gitter.im/cypress-io/cypress?at=6021494e84e66b7f7edd7858

Hi all,
I have a test for a react app for a login page. On that page there is a request fired to get an access token which is supposed to fail with a 401 which it does. So I'm trying to visit a page (in a logged out state) which is supposed to give me a 401, but I'm ignoring it with {failOnStatusCode: false}, however it displays that the test fails (see screenshot above).
What am I doing wrong?
Interestingly enough, when I run the same test 'headless' it tells me it's passing. Is there a bug in the visualization?

image

@bahmutov bahmutov added stage: needs investigating Someone from Cypress needs to look at this and removed stage: needs information Not enough info to reproduce the issue labels Feb 9, 2021
@panzarino
Copy link
Contributor

I think that this could be a regression introduced by some of the changes that I made for studio - I'll investigate

@panzarino panzarino self-assigned this Feb 11, 2021
@panzarino
Copy link
Contributor

I'm saying this before I'm fully certain, but I'm 99% sure that the issue is caused by this and is a regression introduced with the Studio error state updates in 6.4.0.

@panzarino panzarino added type: regression A bug that didn't appear until a specific Cy version release v6.4.0 🐛 Issue present since 6.4.0 and removed type: bug labels Feb 11, 2021
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs investigating Someone from Cypress needs to look at this labels Feb 11, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 15, 2021

The code for this is done in cypress-io/cypress#15037, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 16, 2021

Released in 6.5.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.5.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/reporter This is due to an issue in the packages/reporter directory type: regression A bug that didn't appear until a specific Cy version release v6.4.0 🐛 Issue present since 6.4.0
Projects
None yet
3 participants