Skip to content

Inability to determine reason for invisibility #5974

@badeball

Description

@badeball

Current 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg/driverThis is due to an issue in the packages/driver directorytype: regressionA bug that didn't appear until a specific Cy version releasetype: user experienceImprovements needed for UXv3.8.0 🐛Issue present since 3.8.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions