Cypress page not found meanwhile it works when I load it manually

  automated-tests, cypress, javascript

I’m using cypress-cucumber-preprocessor

I’m using Sauce Labs demo app for automation testing,

I have a step that is supposed to visit the homepage that has the following url:

I have the baseUrl defined in my cypress.json as shown below:


    "baseUrl": "",
    "testFiles": ["**/*.{feature,features}"],
    "chromeWebSecurity": false,
    "env": {
        "fixturesBaseDir": "test_data_files/"

And my step definition as shown below:

When("go back to home page", () => {

When I go to the home page manually:
But when I execute my step I get the following error:

cy.visit() failed trying to load:

The response we received from your web server was:

  > 404: Not Found

This was considered a failure because the status code was not 2xx.

If you do not want status codes to cause failures pass the option: failOnStatusCode: false


Cypress Error


Source: Ask Javascript Questions