Skip to content

getBy error message should include the value that was not found #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sregg opened this issue Sep 21, 2020 · 3 comments
Closed

getBy error message should include the value that was not found #549

sregg opened this issue Sep 21, 2020 · 3 comments

Comments

@sregg
Copy link
Contributor

sregg commented Sep 21, 2020

Describe the Feature

Currently, when a getBy (or findBy) fails, the error is only No instance found.
It would be great to have what value was not found.
e.g. getByText('text that doesn't exist') would throw No instance found with text 'text that doesn't exist'

Possible Implementations

If it's easier to implement you could even omit the type like No instance found: 'text that doesn't exist'

Related Issues

#547
Currently findBy doesn't show the stack-trace so it's hard to know which one failed.
Having a better error message would make it easier to debug, even without the stack-trace.

@thymikee
Copy link
Member

Isn't the code frame enough to determine where the error happens? It should point to the faulty code. If it's not there, it's a bug and should be fixed

@sregg
Copy link
Contributor Author

sregg commented Sep 28, 2020

The stack-trace is not working for findBy and waitFor at the moment (see #547).
Adding the value in the error message seemed to be an easier thing to prioritize.

@mdjastrzebski
Copy link
Member

This is implemented, as all queries now report their predicate: e.g.
Unable to find an element with text: ${String(text)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants