0
Cypress [Solved]
I have an element that is created I believe with JS, I need to check if it exists without causing the cypress test to fail. Perhaps a custom command that returns true or false, something like cy.exists('[test-id=""something]') Any ideas?
3 odpowiedzi
0
What do you mean by "believe"? If you are not sure of the language, you can check the end of the file name. if it ends in .js, it's a Javascript file. If not, please tell us.
0
The element is not in the HTML initially, it appears after you press a button regardless if it is .js or .ts. I simply need to know if it exists or not with cypress e.g.
before
<html>
<head>
</head>
<body>
<input type="button">Some lable</input>
</body>
</html>
after
<html>
<head>
</head>
<body>
<input type="button">Some lable</input>
<h1 test-id="hello">Some header</h1>
</body>
</html>
0
There is a CY.get(). should (not.exist) which does what I require