-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
SessionID set-cookie doesn´t work when using electron #5508
Comments
Hey @johanneslundin, you mentioned |
Yes, but i just manage to fix it. Previously i didn´t have to specify the domain when i set the cookie but now when i dit, it worked. It did something like this. Cypress.Commands.add(
'loginRequest',
(orgId) => {
cy.request('POST', 'http://auth.xx.test:4000/oauth/login', {
email: Cypress.env('email'),
password: Cypress.env('password'),
redirectUri: 'http://beta.xx.test:4200',
}).then(response => {
cy.request('POST', 'http://auth.xx.test:4000/oauth/token', {
code: response.body.authorizationCode,
grantType: 'authorizationCode',
redirectUri: 'http://beta.xx.test:4200',
}).then((response)=> {
cy.setCookie(response.headers['set-cookie'][0], {domain:'.xx.test'})
});
});
}
); We can close this issue:) |
I think this change in behavior will be fixed by #5478. Though, in Also, @johanneslundin, cy.request() should set the cookie on the browser for you, there should be no need to do the cy.setCookie(). There are some bugs with this in the latest release that will be resolved when #5478 . Closing for now. |
Current behavior:
sessions cookie is not set so not possible to bypass the login screen of my application.
Desired behavior:
Just like when using chrome, i want the
sessionID
to be set when using electron so i can run in headlessSteps to reproduce: (app code and test code)
No cookies are sent. when using chrome
sessionsID
was set by the http://auth.xx.test:4000/oauth/token request usingset-cookie
in the response header but this have stopped working.Versions
Cypress 3.5.0
electron 73
The text was updated successfully, but these errors were encountered: