Cypress: cy.click() does not work properly

Created on 21 Nov 2019  路  7Comments  路  Source: cypress-io/cypress

Current behavior:

From version 3.5.0 cypress does not click correctly on elements on the page in CI. Workaround is to pass in {force:true} as an argument, but that is not what I expect how it should work.

Perhaps relates to this bug https://github.com/cypress-io/cypress/issues/3388, which was actually solved in version 3.2.0

Desired behavior:

The same test passed in cypress version 3.4.1.
Click on element should should trigger the javascript function

Steps to reproduce: (app code and test code)

Screenshot (v3.4.1)
cy_click_3_4_1

Screenshot (v3.6.1)
cy_click_3_6_1

AppCode
frontend

Testcode

Cypress.Commands.add('setFavoriteMarket',(zipcode)=>{
  if(zipcode != ""){
    cy.contains('Markt suchen')
    .click()
    .get('input#marktsearch_section').type(zipcode)
    .get('#marktsearch_button').click()
    .get('.jspPane > .result:nth-child(1) .details > .info a')
    **.click()**
    .getCookie('EDEKA_B2C').should('exist').then((c) => {
      return(JSON.parse(JSON.parse(c.value)));
    }).its('marketID').should('be.not.empty',{ timeout: 10000 })
    .get('.o-offers-offer-categories__store-information-item:nth-child(2) p').as('storeAddress')
  }
});>

Versions

3.5.0 and higher

All 7 comments

Having the same issue starting with 3.5.0

does param {force:true} help? or not in this case?

Yes, I already mentioned that in the current behavior part of the bug description

Unfortunately we have to close this issue as there is not enough information to reproduce the problem. We need the HTML to run the test code against, so that we can run the error ourselves.

This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Also please try updating to the current version of Cypress as we've fixed several bugs.

Please comment in this issue with a reproducible example and we will reopen the issue. 馃檹

@jennifer-shehane I also experience this problem, tried with {force: true}, sometimes works if a put long enough of a wait before.

Yes, even force sometimes fails could someone help

If you're experiencing a bug similar to this in Cypress, please open a new issue or comment with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

Was this page helpful?
0 / 5 - 0 ratings