Skip to content

cy.click() failed because element is effective width and height of 0x0, even though it is not. #695

@peterklijn

Description

@peterklijn

Hi there,

I'm encountering some flaky tests due to an element not being considered visible by Cypress, I don't understand what makes an element visible or not visible by Cypress and was hoping someone could clarify it for me.

Since version 0.20 tests randomly decide to fail with this message: This element '<a.sc-cqpYsc.cmkxre>' is not visible because it has an effective width and height of: '0 x 0' pixels..
However, when I inspect it is definitely has a size bigger then 0 by 0, as you can see in the screenshots.

Failing test due to click timeout:
screen shot 2017-09-29 at 11 44 37

Item highlighted by Cypress:
screen shot 2017-09-29 at 11 33 11

Chrome inspect of the element:
screen shot 2017-09-29 at 11 34 22

Now, I can "fix" this by adding { force: true } to the click, but I would like to understand why this results in flaky behaviour (both headless and using the cypress UI).


  • Operating System:
    locally: OSX 10.12.6
    CI: Debian Stretch (Docker container node:6.11.3-stretch)
  • Cypress Version:
    0.20.0 & 0.20.1
  • Browser Version:
    Version 61.0.3163.100 (Official Build) (64-bit) (locally)

Is this a Feature or Bug?

Bug?

Current behavior:

cy.click() failed because element is not visible

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions