You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing e2e tests, connecting to a real server, doing a POST request sends an empty json body and headers are not correct.
These are the headers in cypress using electron:
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7
The server doesn't receives a body payload neither.
Screenshot of the headers in electron when running cypress
Network panel for POST /login request
Server response
Desired behavior
Cypress should not change request header and should send json body payload.
Screenshot of the request in firefox when using the app without cypress
Headers for the post request
Test code to reproduce
This is the cypress test file that we are using:
describe('Login page', () => {
const email = 'e2e@testing.com';
const password = 'password';
it('should succesfully log in the app and redirects to transactions page', () => {
cy.visit('/login');
cy.get('#email').type(email);
cy.get('#password').type(password);
cy.get('[data-testid="login-form"]').submit();
cy.location('pathname').should('eq', '/transactions')
});
});
Cypress Version
14.0.0
Node version
22.11.0
Operating System
Windows 11 PRO. Using ubuntu 22.04.2 LTS inside WSL2 with XLaunch
Debug Logs
Other
Note that we are actually connecting to a real server with real database, so the test we are writing is not mocked in any way, nor the requests are intercepted.
The text was updated successfully, but these errors were encountered:
I test this issue outside of the WSL2 echosystem, now on a Mac, and seems to be working fine... But our main machines are windows... so it is a weird bug...
Current behavior
When writing e2e tests, connecting to a real server, doing a POST request sends an empty json body and headers are not correct.
These are the headers in cypress using electron:
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7
The server doesn't receives a body payload neither.
Screenshot of the headers in electron when running cypress
Network panel for POST /login request
Server response
Desired behavior
Cypress should not change request header and should send json body payload.
Screenshot of the request in firefox when using the app without cypress
Headers for the post request
Test code to reproduce
This is the cypress test file that we are using:
Cypress Version
14.0.0
Node version
22.11.0
Operating System
Windows 11 PRO. Using ubuntu 22.04.2 LTS inside WSL2 with XLaunch
Debug Logs
Other
Note that we are actually connecting to a real server with real database, so the test we are writing is not mocked in any way, nor the requests are intercepted.
The text was updated successfully, but these errors were encountered: