Origin header is not getting passed while visiting the website using cypress
See original GitHub issueCurrent behavior
My Widgets in the website are not loading while trying to visit the site using cypress automation and it’s showing 500 error response code. But I can see my website is loading successfully with all the widgets when I visit manually. I observed that origin header is missing while visiting the site using cypress.
I tried changing the websecurity in the cypress.config file to ‘true’. But it didn’t resolved my issue. Missing header:: Origin: https://esolution-citizenportal2.dev.esolg.ca code for visiting the page:
describe('Adding a single property', () => {
it('T02 - check login credentials', () => {
const sentArgs = { username: 'VijayKumar.Chinthalapudi@ghd.com', password: 'Amstrong@66' }
cy.origin('https://esolution-citizenportal2.dev.esolg.ca',
{ args: sentArgs },
({ username, password }) => {
console.log('test2');
cy.visit('/');
console.log('test3');
cy.get('#email').clear().type('VijayKumar.Chinthalapudi@ghd.com');
cy.get('#password').clear().type('Amstrong@66');
cy.get('#next').click();
})
})
})
Receiving the below error while using the above code:
Timed out retrying after 4000ms: The command was expected to run against origin https://esolution-citizenportal2.dev.esolg.ca but the application is at origin https://esolution-citizenportal2.dev.esolg.ca.
This commonly happens when you have either not navigated to the expected origin or have navigated away unexpectedly.
Desired behavior
Timed out retrying after 4000ms: The command was expected to run against origin https://esolution-citizenportal2.dev.esolg.ca but the application is at origin https://esolution-citizenportal2.dev.esolg.ca.
This commonly happens when you have either not navigated to the expected origin or have navigated away unexpectedly.
Test code to reproduce
describe('Adding a single property', () => {
it('T02 - check login credentials', () => {
const sentArgs = { username: 'VijayKumar.Chinthalapudi@ghd.com', password: 'Amstrong@66' }
cy.origin('https://esolution-citizenportal2.dev.esolg.ca',
{ args: sentArgs },
({ username, password }) => {
console.log('test2');
cy.visit('/');
console.log('test3');
cy.get('#email').clear().type('VijayKumar.Chinthalapudi@ghd.com');
cy.get('#password').clear().type('Amstrong@66');
cy.get('#next').click();
})
})
})
Cypress Version
v.10.11.0
Node version
v14.17.6
Operating System
Windows 10 Enterprise
Debug Logs
No response
Other
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:28 (3 by maintainers)
Top GitHub Comments
@StephaneColson, could you log a separate issue for this? I’d be interested if you could give us a reproducible example, Cookie handling is tricky.
Right now there doesn’t seem to be enough information to reproduce the problem on our end. Unless we receive a reliable reproduction, we’ll eventually 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 provide a reproducible example of the issue you’re encountering. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.