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

Selector playground doesn't correctly escape colon char in selector suggestion #27258

Open
dgodongm opened this issue Jul 10, 2023 · 3 comments
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory stage: awaiting external fix A 3rd party bug in Cypress - awaiting release topic: selector playground 🚸 type: bug

Comments

@dgodongm
Copy link

dgodongm commented Jul 10, 2023

Current behavior

Similar issue to #3902

  1. Run script that visits https://joinmastodon.org/
  2. Use selector playground, to get selector for the 'Stay in control of your own timeline' h2 element

Results:
Suggested selector is:
cy.get(':nth-child(1) > .full-width-bg__inner > .xl\:col-start-2 > .h4')

Screenshot:
Screenshot 2023-07-10 at 10 37 27 AM

Desired behavior

The colon should be double escaped to work:
cy.get(':nth-child(1) > .full-width-bg__inner > .xl\\:col-start-2 > .h4')

Test code to reproduce

describe('home page tests', () => {
  beforeEach(() => {
    cy.visit('/')
  })

 
  it('Stay in control', () => {
    cy.get(':nth-child(1) > .full-width-bg__inner > .xl\:col-start-2 > .h4').should('have.text', 'Stay in control of your own timeline')
  })
})

Cypress Version

12.16.0

Node version

v19.7.0

Operating System

macOS 13.3.1 (a)

Debug Logs

No response

Other

No response

@lmiller1990
Copy link
Contributor

@lmiller1990
Copy link
Contributor

I looked around and I think this needs to be patched in the cypress/unique-selector module. That's here.

Are you interested in making a PR?

@lmiller1990 lmiller1990 added stage: awaiting external fix A 3rd party bug in Cypress - awaiting release pkg/driver This is due to an issue in the packages/driver directory labels Jul 11, 2023
@SangilYun
Copy link

It looks like the CSS.escape dependency might be causing this issue. mathiasbynens/CSS.escape#17

@jennifer-shehane jennifer-shehane removed the good first issue Good for newcomers label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory stage: awaiting external fix A 3rd party bug in Cypress - awaiting release topic: selector playground 🚸 type: bug
Projects
None yet
Development

No branches or pull requests

4 participants