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

482
Visualizações
Testcafe fails to connect to localhost on OSX

I'm having very strange recurring issues connecting to a locally served vuejs application (nodejs). localhost:8080 successfully loads in a local browser, but regardless of configuration testcafe returns: Failed to find a DNS-record for the resource at "http://localhost:3000/".

I emptied .testcaferc.json and created the following Minimum Working Example: testcafe "chrome" tests/testcafe_debug.test.js --app "npm run serve" --app-init-delay 1 -S -s

tests/testcafe_debug.test.js:


fixture `Fixture`
  .page('http://localhost:8080/login');

test('test', async t => {
  await t
    .click('body')
    .expect(Selector('div p a').text).eql('Register Here');
});

This is actually the second time I've seen the problem. Visiting a friend an on a new network, connections failed until I added --proxyBypass localhost to the test run. This fixed the issue for the moment, but now I'm having the same errors a few weeks later. Things I've looked into:

  • --hostname localhost has no effect
  • There's nothing strange in /etc/hosts.
  • No change if I turn off my wifi connection or adjust the proxy settings I'm not running a firewall or vpn. I'm not sure where else to look. Any suggestions or advice would be profoundly appreciated.
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

In your TestCafe launch command, you allow just one millisecond for the application to load (--app-init-delay 1). It looks like TestCafe requests the page before the server is ready. Try to increase this delay (specified in milliseconds) so that it's enough for your app server to start up and serve the tested app.

The following example specifies a ten-second delay:

testcafe "chrome" tests/testcafe_debug.test.js --app "npm run serve" --app-init-delay 10000 -S -s

UPD: looks similar to https://github.com/DevExpress/testcafe/issues/6844

about 4 years ago · Juan Pablo Isaza Relatório

0

I had the same problem because I changed node versions in between runs.

Thanks to @vasily.strelyaev's comment I found the solution.

about 4 years ago · Juan Pablo Isaza 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