URL: https://portal-sms-staging.eggdigital.com/signin
Cypress.Json
"chromeWebSecurity": false,
"testFiles": "**/*.{feature,features}",
"ignoreTestFiles": ["**/stepDefinitions/*","*.js", "*.md"],
"reporter": "mochawesome",
"reporterOptions": {
"reportDir": "cypress/report/mochawesome-report",
"overwrite": true,
"charts": true,
"html": true,
"json": false,
"timestamp": "mmddyyyy_HHMMss"
}
}
static loadHomePage(){
//cy.on('uncaught:exception', (err, runnable) => { return false; })
cy.visit('/signin', { timeout: 80000 })
cy.url().should('include', 'eggdigital')
}
Error getting: cy.visit() failed trying to load:
https://portal-sms-staging.eggdigital.com/signin
The response we received from your web server was:
404: Not Found
This was considered a failure because the status code was not 2xx.
This http request was redirected '1' time to:
If you do not want status codes to cause failures pass the option: failOnStatusCode: false
I've searching for solution many times, and found:
when browser: send request header and response status code OK when using cy.visit(): response status code Not Found
So the problem is request header, you better check it, and set Headers when you visit look like browser Headers to recived status code OK.