Hey community! I have a dumb begginers question, l...
# best-practices
f
Hey community! I have a dumb begginers question, looking for advice. I have to test that a record has been removed from a table after some actions. My step is is cy.get(#table tbody tr).contains(rowName).should("not.exist") Now the thing is when the element doesn't exist, the contains() part results in "undefined", therefore, the should() statement verifies that undefined doesn't exist, and the test passes. If the element does exist, it will resolve into an element, and the should() part will fail. So in both cases the assertion is fine and works. My question for you is, is this how this is supposed to go? I try to find an element that results in undefined, and then the should will look for undefined to not exist? Shouldn't it check for the actual rowName to not exist? The assert log in the runner says "assert expected undefined not to exist in the DOM". I would expect it to say "assert expected rowName not to exist in the DOM"e