Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

2.7K
Visualizações
Cypress - cy.visit() failed trying to load

Problem
I am running an integration test for Cypress which works fine locally but fails when I run it in Gitlab. The error I am receiving is while using the cy.visit() command that results in the following error:

CypressError: `cy.visit()` failed trying to load:
http://localhost:3000/ The response we received from your web server
was:
  404: Not Found

Configuration
I launch the test with the following commands:

tests:
  image: cypress/base:10
  stage: tests
  script:
    - npm ci
    - npm run test:ci

The commands look like this in my package.json:

      "scripts": {
        "start:ci": "serve dist --no-clipboard --listen ${PORT:-3000}",
        "test": "cross-env NODE_ENV=test && npm run test:jest && npm 
run test:cypress",
        "test:ci": "start-server-and-test start:ci http://localhost:3000 test",
        "test:cypress": "cypress run --headless",
        "test:jest": "jest",
      },

Research
I have looked into the error and found this thread which helped me understand the issue a little bit. I then tried adding the following config to my cypress.json file:

{
  "baseUrl": "http://localhost:3000"
}

but I still get the same error. Why would this be?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

1

Add a slash to the end of the url or if you can remove the slash when placing the request.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda