Volodymyr Pliuta
Volodymyr Pliuta

Reputation: 147

Cypress, cy.visit() failed trying to load ESOCKETTIMEDOUT

works on www.github.com

cy.visit() failed trying to load ESOCKETTIMEDOUT

but not on other websites

Upvotes: 5

Views: 10564

Answers (4)

Ryan Nichols
Ryan Nichols

Reputation: 1

In my case I was using several services through docker-compose and I needed to wait for my frontend to be up before starting my Cypress tests

Upvotes: 0

For me was resolved by adding the following in the Cypress Config:

headers: { "Accept-Encoding": "gzip, deflate" }

That the entire test argument is:

it("", () => {
  cy.visit(url, { headers: { "Accept-Encoding": "gzip, deflate" } });
});

#Ref: https://github.com/cypress-io/cypress/issues/7062#issuecomment-991427658

Upvotes: 3

Kazys
Kazys

Reputation: 477

In my case some time was needed until web application boots for the first time. And in that case I got ESOCKETTIMEDOUT. It is a bit different than request can be made and waiting for response. I had to add following timeout

cy.visit('http://my.site.to.test', { responseTimeout: 120000 });

Upvotes: 1

Volodymyr Pliuta
Volodymyr Pliuta

Reputation: 147

from: https://github.com/cypress-io/cypress/issues/7062

  1. increase timeout

    cy.visit('https://github.com/', { timeout: 30000 })

Upvotes: 3

Related Questions