Cypress should fire 'mouseover' event on .click()
See original GitHub issueCurrent behavior:
Unable to click on the first suggestion from google place auto complete
Video: https://drive.google.com/open?id=11dxli8EzoozjZ0LfAmDT6IJKHWKtlNKy
Desired behavior:
Can click on the first suggestion
Steps to reproduce:
The following script would fail. For some reason click wouldn’t pick the item here. I’ve tried selenium and the click worked for me.
cy
.visit('https://developers.google.com/maps/documentation/javascript/examples/full/places-autocomplete')
.get('#pac-input')
.should('be.visible')
.wait(1000)
.type('22 Princes Highway, Darlington NSW, Australi')
.get('.pac-item')
.first()
.should('be.visible')
.click()
.get('#pac-input')
.then((result) => {
expect(result.val()).to.eq('22 Princes Highway, Darlington NSW, Australia');
});
Versions
Cypress 3.0.1 Mac 10.13.4 Electron 59
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
hover - Cypress Documentation
If the hover behavior depends on a JavaScript event like mouseover , you can trigger the event to achieve that behavior. Using .trigger()...
Read more >Handling Touch and Mouse events using Cypress
If your apps are designed to handle right-click events then you can use the rightclick() command in Cypress to simulate the right-click actions....
Read more >Handling Touch And Mouse Events In Cypress [Tutorial]
In this Cypress tutorial, we talk about handling touch and mouse events when running Cypress test automation scripts.
Read more >Mouseover in cypress - Stack Overflow
You can use the cypress-real-events plugin and this worked with your webpage. ... it.only("Mouse hover using trigger ", () => { cy.viewport(1440, ...
Read more >Handle mouse hover events in cypress – Part 2
Handle mouse hover events in cypress using trigger method · it.skip to skip a test ·.first().click() to click first occurrence of an ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello all, I believe this issue is because we do not yet fire the
mouseover
event on cy.click. This will be fixed along with native events in #2956Until then, please use this workaround when clicking on the auto-complete suggestion:
I’m having the same issue, my workaround for now is to use the
type()
method, likeI found
click()
ensured more reproducible behaviour from the google component, since I was not able to catch the JSONP requests in mycy.server()
routes. A fix here would be great.