Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 706
sunwoo Lee Avatar asked Jan 26 '26 11:01

sunwoo Lee


1 Answers

For the record,

cy.origin('https://www.linkedin.com', () => {
  cy.visit('/in/sunwoo0706', {failOnStatusCode: false})  // redirects to login page
})
like image 153
Fody Avatar answered Jan 28 '26 01:01

Fody



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!