Skip to content

Check if multiple tests using only a single cy.visit in before block produce code coverage #137

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

Closed
bahmutov opened this issue Feb 14, 2020 · 6 comments · Fixed by #152
Closed
Labels

Comments

@bahmutov
Copy link
Contributor

or if the second test clobbers the coverage from the first one

I have seen this in cypress-io/cypress-realworld-app#115

@CalebGM
Copy link

CalebGM commented Mar 4, 2020

Is this issue stating that having a single cy.visit in the before() block for multiple it() tests won't produce the correct code coverage?
Because that's the issue I seem to be having. I have a single before() block that does the visit then multiple tests that check for elements on that page, but my coverage was very low. Changing the before() to a beforeEach() greatly improves my code coverage but also makes my tests slower since it's reloading the page for each it() block

@bahmutov
Copy link
Contributor Author

bahmutov commented Mar 4, 2020 via email

@CalebGM
Copy link

CalebGM commented Mar 4, 2020

Yes that is unfortunate. Do you have any idea if it's planned to be fixed soon?

@bahmutov
Copy link
Contributor Author

bahmutov commented Mar 4, 2020 via email

@danmaftei
Copy link

@CalebGM I fixed this with the following fork: danmaftei@45c1ff4

@bahmutov
Copy link
Contributor Author

bahmutov commented Mar 9, 2020

🎉 This issue has been resolved in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants