cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.66k stars 3.16k forks source link

Unable to access Salesforce Lightning elements even with {includeShadowDom: true} #29294

Open alexsch01 opened 5 months ago

alexsch01 commented 5 months ago

Current behavior

image

Test code to reproduce

git clone https://github.com/alexsch01/cypress-repro-salesforce
cd cypress-repro-salesforce
npm install
npx cypress run --headed --no-exit

Cypress Version

13.7.0

Node version

v18.13.0

Operating System

Windows 10.0.19045.4170

Other

Repo for Cypress test: https://github.com/alexsch01/cypress-repro-salesforce

alexsch01 commented 4 months ago

Same issue on cypress@13.9.0

jennifer-shehane commented 2 months ago

I confirmed this is happening and reproducible given the example. There's this call, where we call into jquery with the selection and the 'scope', where it's failing within jquery in that call. https://github.com/cypress-io/cypress/blob/remove-json-lint/packages/driver/src/cy/commands/querying/querying.ts#L198

Screenshot 2024-06-18 at 1 12 15 PM

I have a hunch that maybe we're not finding all the shadow dom to pass through the scope here? We're using a pretty old version of jquery here also that may not be helping.

kathleennaughton commented 1 month ago

I am also struggling with not being able to access Salesforce Lightning elements from my Cypress tests. I can interact with the elements within the Cypress test runner but any method and configuration I've tried, I get "timeout" because the element is not found. Is there any hope that this will be addressed soon?

alexsch01 commented 1 month ago

@jennifer-shehane I just confirmed this still happens with Cypress 13.13.1