https://cypress.io logo
Clean slate with the form
# i-need-help
b
I have a spec file which tests registration and it has several it blocks (test scenarios). Some scenarios which run first leave the form populated with some values after the tests are finished. This makes problems from my later it blocks which expects the form to be in the state in which it would have been if the form was initially loaded. How do I prevent or fix this to have the clean slate for my form after my first tests have been run?
I tried with cy.reload(true), but it didn't help
the frontend of the app is react and the radio button for salutation is checked and I cannot uncheck it in any way
when I do it manually, I check the radio button, reload the page and then the radio button is not checked any more
but with cy.reload this doesn't behave the same way
t
What Cypress version are you using? As from Cypress 12 the new test isolation should enforce all tests to wipe the slate clean by default: https://docs.cypress.io/guides/core-concepts/test-isolation
b
I use Cypress 10.10.0
Is it a big effort to upgrade to version 12?
t
That depends on what you're using but generally speaking not too much. Not as big as going from Cypress 9 to 10 I would say. I guess it's best to just give it a try and you should quickly get an idea of what is broken.
b
Thanks, this helped 🙂 We just need to verify if all other tests are still working, but I think it should be fine