Inability to determine reason for invisibility
See original GitHub issueCurrent behavior:
Per v3.8.0, one might receive a message stating EG. Cypress could not determine why this element '<button>' is not visible.
This is non-sensical, as there’s obviously some heuristic implemented that has determined the element to be invisible.
I understand that there’s a method getReasonIsHidden
that is somewhat replicating the behavior of isHidden
, but returning a human-readable string instead of a boolean value. I am however having a very hard time understanding why you would implement it like this.
Since there should be one, and only one, heuristic-implemention, why not make one a function of the other?
const getReasonIsHidden = function ($el) {
// Implementation ...
}
const isHidden = ($el) => {
return !!getReasonIsHidden($el);
}
Desired behavior:
Never to see such a non-informative error message.
Steps to reproduce: (app code and test code)
Doesn’t really matter here, but I can see if I can produce a minimal example.
Versions
Cypress v3.8.0, Arch Linux, Chrome 77.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (10 by maintainers)
Here’s an example of what I mean by sharing heuristic, without changing the current interface.
Yah, there’s a larger issue to evaluate our error messages - showing why something is invisible or visible here: https://github.com/cypress-io/cypress/issues/677
As far as I have seen, there aren’t any open issues of a situation where the ambiguous error ‘could not determine why’ is showing for anyone in the current version.