Cypress cy.origin is doesn't work when it link to LinkedIn

895 Views Asked by At

I was developing a feature that redirects users to profiles on various platforms. And to test this, I wrote the following code using the newly released cy.origin yesterday.

cy.origin('www.example.com', () => {
    cy.visit('/username')
})

However, github and twitter were successfully redirected, but linkedin was not the only one.

error image

I think the problem is caused by the user agent. Is there any way to solve this problem?

1

There are 1 best solutions below

3
Fody On

For the record,

cy.origin('https://www.linkedin.com', () => {
  cy.visit('/in/sunwoo0706', {failOnStatusCode: false})  // redirects to login page
})