DEV Community

Discussion on: How to test Vue apps with the popular Cypress framework

Collapse
 
bahmutov profile image
Gleb Bahmutov

Nihar, good article but I don't think the statement "Cypress makes sure this test will not run if the first test doesn't pass." is correct. Cypress will not run the test if a "before" or "beforeEach" hook fails, but it will happily run the second test even if the first test fails. We advise to make your tests independent from each other - if you need a couple of todos for the second test to complete - just create them using a beforeEach and a custom command.

See our example tests for TodoMVC here github.com/cypress-io/cypress-exam... and in-depth TodoMVC tests for Vue.js specifically here cypress.io/blog/2017/11/28/testing...

Collapse
 
napoleon039 profile image
Nihar Raote

Thank you for correcting me. I started with Cypress recently so I didn't know it was like this. I think I saw an example with a test failing and subsequent tests not running in some specific situation and thought that meant a test failing means the tests following it will fail as well.

I will make sure to check out the GitHub example you linked to 🙂