Skip to content
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

3.5.0 cy.click() behavior change caused broken tests #5459

Closed
leimd opened this issue Oct 24, 2019 · 7 comments · Fixed by #5496
Closed

3.5.0 cy.click() behavior change caused broken tests #5459

leimd opened this issue Oct 24, 2019 · 7 comments · Fixed by #5496
Assignees
Labels
type: regression A bug that didn't appear until a specific Cy version release v3.5.0 🐛 Issue present since 3.5.0

Comments

@leimd
Copy link

leimd commented Oct 24, 2019

Current behavior:

With the update to 3.5.0, Cypress has stopped working with Select 2 library, when click() is called on the drop down element, no drop down is shown. @rakhid and I have made a sample test in Cypress and recorded video to show the problem.

Video Recording 3.5

Desired behavior:

When triggering click on the drop down element, a drop down should be shown Video Recording 3.4

Steps to reproduce: (app code and test code)

Here is a sample repo that we made to show the bug, there are two branches: cypress-34 and cypress-35 which has Cypress 3.4.0 and Cypress 3.5.0 in their package.json respectively. By checking out the respective branch and run npx cypress run, you can recreate the bug.

Versions

Cypress 3.5.0
Browser: Chrome & Electron

@leimd leimd changed the title 3.5.0 Stopped working with Select 2 Library 3.5.0 cy.click() behavior change caused broken tests Oct 25, 2019
@leimd
Copy link
Author

leimd commented Oct 25, 2019

More Notes from my investigation

It seems that this is how it works in 3.4:
in click.js , x and y coordinates are determined, and then a $actionability.verify (...) is returned.

In actionability.coffee, in the verify method, at line 263:
ensureElIsNotCovered(cy, win, $el, coords.fromViewport, options, _log, onScroll) is triggered,
inside ensureElIsNotCovered , eventually this is executed, which subsitutes the element to the deepest element that we are about to interact with and let the events bubble up.

ensureDescendents = (fromViewport) ->
    ## figure out the deepest element we are about to interact
    ## with at these coordinates
    $elAtCoords = getElementAtPointFromViewport(fromViewport)

, what's behind getElementAtPointFromViewport is doc.elementFromPoint(x, y) which

@jennifer-shehane
Copy link
Member

I can confirm that the provided repo passes in 3.4.1 and fails in 3.5.0 https://github.com/leimd/cypress-bug-demo

@jennifer-shehane jennifer-shehane added the type: regression A bug that didn't appear until a specific Cy version release label Oct 28, 2019
@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Oct 28, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs investigating Someone from Cypress needs to look at this stage: work in progress labels Oct 28, 2019
@jennifer-shehane
Copy link
Member

There's a PR open to fix this here: #5496

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs review The PR code is done & tested, needs review labels Oct 28, 2019
@leimd
Copy link
Author

leimd commented Oct 28, 2019

Thanks @jennifer-shehane !

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Oct 28, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Oct 29, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 29, 2019

The code for this is done in cypress-io/cypress#5496, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

1 similar comment
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 29, 2019

The code for this is done in cypress-io/cypress#5496, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 5, 2019

Released in 3.6.0.

@jennifer-shehane jennifer-shehane added the v3.5.0 🐛 Issue present since 3.5.0 label Dec 10, 2019
@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v3.5.0 🐛 Issue present since 3.5.0
Projects
None yet
3 participants