cypress-io / cypress-example-kitchensink

This is an example app used to showcase Cypress.io testing.

Home Page:https://example.cypress.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The `rightclick()` test on the example pages shows the incorrect selectors

DionisIno opened this issue Β· comments

Current behavior

The rightclick() example shows the following selectiors:

cy.get('.action-div').rightclick().should('not.be.visible')
cy.get('.action-input-hidden').should('be.visible')

Desired behavior

The selectors should be:

cy.get('.rightclick-action-div').rightclick().should('not.be.visible')
cy.get('.rightclick-action-input-hidden').should('be.visible')

Cypress Version

12.5.0

Node version

v19.4.0

Operating System

Windows 11, version 22H2

Debug Logs

No response

Other

No response

Hi @DionisIno πŸ‘‹, I have not been able to reproduce your issue. I just created a new project and ran the test you provided and it passed as expected.

  describe ('My First Test', () => {
    it ('Gets, types and asserts', () => {
      cy.visit ('https://example.cypress.io');
  
      cy.contains ('type').click ();
  
      // Should be on a new URL which
      // includes '/commands/actions'
      cy.url ().should ('include', '/commands/actions')
  
      cy.get('.rightclick-action-div').rightclick().should('not.be.visible')
      cy.get('.rightclick-action-input-hidden').should('be.visible')
    });
  });

Image

Would you be able to recreate the steps you posted above in a reproduction repository by forking cypress-test-tiny or by other means?

Good afternoon!
With this code, it passes. But on the site you have other locators registered.

cy.get('.action-div').rightclick().should('not.be.visible')
cy.get('.action-input-hidden').should('be.visible') - This code is presented on the site. And it finds locators for another test, not for right click, but for double click.

Here is the link: https://example.cypress.io/commands/actions

@DionisIno, thanks for the clarification! I am going to transfer this issue to the cypress-example-kitchensink repository.

Would you be willing to contribute a fix for this issue? The change would be located here.

That would be great!

Good afternoon. I don't know git very well. Submitted the changes, but the first 10 checks failed. Can you advise me how to proceed?

Thanks @DionisIno, it looks like there is an issue with the Record Key which is not something you can change. I'll try and take a look later today.

πŸŽ‰ This issue has been resolved in version 1.16.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€