I have a problem with Cypress. I have localhost fired up and in all browsers (Chrome, Firefox, Opera) my app opens. On the other hand, in Cypress when enabling tests (Chrome, Firefox, Electron), I have a problem with the backend. The login page opens, but when I enter my login details, I get an error related to the backend.
Cypress version 12.14.0
I tried doing downgrades to lower versions of Cypress, I uninstalled and installed NPM on the frontend and backend.
In Firefox, it shows an error like this "Cross-Origin Request Blocked: same-origin rules prevent reading of remote resource (Reason: CORS request failed). Status code: (null)". In Chrome, it only shows such an error "TypeError: NetworkError when trying to retrieve a resource.". But as I say, in a "normal" browser everything works ok. Only when firing up the tests there is an error.
chromeWebSecurity is set to false of course.
Things I have already tried:
- Tested to see if using a Incognito instance was the issue.
- Removed frontend project, removed Cypress folders including cache folder and pulled project down again.
- Tested if it was only relating to Chromium browsers. Issue exists in Firefox also.
- Set flags in the cypress.json folder for chromeWebSecurity to false.
- Tried different login methods using the UI and also using cy.session
- Tried pausing the Test Runner, manually opened a new tab, enter localhost, tried to log in, the same error
- A colleague also tried to fire it up on another laptop In the end, I did a laptop format (Macbook Air 2015) because it needed a refresh anyway