I have a test which only asserts that something do...
# help
s
I have a test which only asserts that something does not exist. This test will always pass (which makes sense) unless I set a timeout to wait, find another element which should exist first, or wait for a network request to finish. What doesn't make sense to me is that I need to check something else exists prior to asserting that the other thing does not.
Copy code
ts
cy.visit(url).get('.thing').should('not.exist'); // always passes (false positive potentially)
cy.visit(url).get('.first').get('.thing').should('not.exist'); // correctly passes
In this instance, if I change
.first
to another name or remove it, then the test is impacted even though it is not a concern or focus of this particular test, rather it is a means to an end. What the more common or correct approach to this test?