assert.dom(Element).exists() throws even if it exists
See original GitHub issueEven though officially the dom
method accepts the Element
type, when using it that way the exists
method ends up throwing an error, even if the element exists. At root, this is because exists
calls findElements
, which is not currently set up to check for this.target
being anything other than a string.
I have a PR inbound shortly to add support to findElements
for having Element targets, but wanted to track it here also.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
assert.dom(Element).exists() throws even if it exists · Issue #245
At root, this is because exists calls findElements, which is not currently se ... assert.dom(Element).exists() throws even if it exists #245.
Read more >How can I check if an element exists in the visible DOM?
It seems some people are landing here, and simply want to know if an element exists (a little bit different to the original...
Read more >Cypress basics: check if element exists - Filip Hric
In this article we are exploring ways to assert visibility of an element on a page. There are couple of gotchas that may...
Read more >Assertions | Cypress Documentation
When adding an element to the list and using a positive assertion, the test asserts a specific number of Todo items in our...
Read more >Appearance and Disappearance - Testing Library
Appearance and Disappearance. Sometimes you need to test that an element is present and then disappears or vice versa.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ready to go! Just waiting for a merge/release. Thanks for your patience, everyone!
Bumping this… We see the error with
assert.dom(element).isVisible()
@dwilhelmi will you have time to wrap up the PR? If not, would you care if I take it over?