cypress-io / cypress-chrome-recorder

Export Cypress Tests from Google Chrome DevTools' Recorder
MIT License
226 stars 18 forks source link

Export as a Cypress Test script doesn't work when using only aria-labels as selectors #37

Closed pabloosso closed 1 year ago

pabloosso commented 1 year ago

I want to use only aria-label as selectors for my tests. After recording I edit each step and I remove the CSS selectors. When trying to export it as a cypress test the extension won't work anymore (it does nothing when I click the download icon).

I've also tried doing the same using the CLI to transform a json file with aria-label as selectors and I get this error:

TypeError: Cannot read properties of undefined (reading '0')
    at handleSelectors (file:///usr/local/lib/node_modules/@cypress/chrome-recorder/dist/CypressStringifyExtension.js:136:63)

Could you please help me? Thank you.

pabloosso commented 1 year ago

Removing the aria-label is a decision and not an issue.

// Remove Aria selectors in favor of DOM selectors https://github.com/cypress-io/cypress-chrome-recorder/blob/41cf2792177c6e8d806afea2333f571687d9de14/src/CypressStringifyExtension.ts#L192