question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

assert.dom(Element).exists() throws even if it exists

See original GitHub issue

Even 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:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
scalvertcommented, Oct 11, 2019

Ready to go! Just waiting for a merge/release. Thanks for your patience, everyone!

1reaction
step2yeungcommented, May 30, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found