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

Salesforce returns Component Error under the Cypress test #21233

Closed
tit opened this issue Apr 27, 2022 · 14 comments
Closed

Salesforce returns Component Error under the Cypress test #21233

tit opened this issue Apr 27, 2022 · 14 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@tit
Copy link

tit commented Apr 27, 2022

Current behavior

Hello, I try to open Salesforce page with Lightning Web Security (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.security_lwsec_intro).
But under Cypress Salesforce returns Component Error.
If I use Playwright, then Salesforce not returns this error.

cypress
playwright

Desired behavior

No response

Test code to reproduce

describe('playground', () => {
  it('playground', function () {
    cy.request({
      body: {
        display: 'page',
        hasRememberUn: true,
        height: '1080',
        lt: 'standard',
        pw: Cypress.env('password'),
        un: Cypress.env('email'),
        useSecure: true,
        username: Cypress.env('email'),
        width: '2560',
      },
      form: true,
      method: 'POST',
      url: 'https://login.salesforce.com',
    })

    cy.visit('https://incountrycom-dev-ed.lightning.force.com/lightning/n/TestCypressPage')
  })
})

I can provide credentials from Salesforce Instance in a personal email message.

Cypress Version

9.6.0

Other

No response

@AtofStryker
Copy link
Contributor

@tit can you see if this is fixed by #24290 (comment) in 12.4.0 on release a week from Tuesday?

@AtofStryker
Copy link
Contributor

Going to close this issue due to inactivity, but if this continues to be a problem please open another issue!

@enesyildir
Copy link

Hello, I am using 12.4.0 cypress version, and I still see this error in my tests

@AtofStryker
Copy link
Contributor

Hi @enesyildir. Did you try 12.4.0 with the experimentalSkipDomainInjection configured for your test domain?

@enesyildir
Copy link

@AtofStryker Hello, that fixed the chrome issue, but this component error still happens when I run my tests.

@AtofStryker AtofStryker reopened this Feb 21, 2023
@AtofStryker
Copy link
Contributor

@enesyildir I have reopenned the issue. Would you be able to to provide salesforce credentials so we can access the reproduction site?

@jeanabanto
Copy link

I am getting a similar error, currently running in 12.8.1. Haven't tried with other test frameworks, but so far we can't reproduce it manually.

Screenshot 2023-03-21 at 1 41 54 pm

@jeanabanto
Copy link

Tried running the same tests that are producing the component error on Firefox, and the popup error does not appear. Seems like this is another error on Salesforce that only happens in Chromium browsers.

It still shows there is an uncaught exception in the logs when running on Firefox, but (fortunately) it doesn't prompt the component error that can block elements under test.
Screenshot 2023-03-22 at 11 54 53 am

@AtofStryker
Copy link
Contributor

@jeanabanto Are you able to create a reproduction repository we can run on our end to validate the issue?

@jeanabanto
Copy link

@AtofStryker I am unable to create a reproduction repository without giving out access to our internal APIs and applications. The error appears only on specific scenarios within our application that runs on salesforce. Enabling chromeWebSecurity to true however, prevents the pop-up error (similar behaviour on Firefox where there is no configuration to disable the same origin policy).

@AtofStryker
Copy link
Contributor

@jeanabanto interesting. Just to clarify, are you setting chromeWebSecurity to true or false?

@jeanabanto
Copy link

@AtofStryker by default in our config file, chromeWebSecurity is false since several tests involving iframes require this configuration. Now to prevent the popup component error, we need the chromeWebSecurity to be true.

@jennifer-shehane
Copy link
Member

Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please comment in this issue with a reproducible example and we will consider reopening the issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Oct 5, 2023
@jennifer-shehane
Copy link
Member

This experimental flag will be made default behavior in Cypress 14 with injectDocumentDomain being false. #30770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

9 participants