-1

I have no previous experience working with Cypress and i'm stuck on such simple problem - cypress can't reach the united.com website. Any other page opens easily. Any suggestions?

visit https://www.united.com/en/us/
CypressError
Timed out after waiting 60000ms for your remote page to load.

Your page did not fire its load event within 60000ms.

You can try increasing the pageLoadTimeout value in cypress.json to wait longer.

Browsers will not fire the load event until all stylesheets and scripts are done downloading.

When this load event occurs, Cypress will continue running commands.
cypress/integration/united.com.js:14:12
  12 | 
  13 |         //Step 1 - open main page
> 14 |         cy.visit(Cypress.env("env").UNITED_BASEURL)
     |            ^
  15 | 
  16 |         //Step 2 - select 'one-way flight'
  17 |         cy.get(mainRoot.body.oneway_radio_button, { timeout: 10000 }).should('be.visible').click()
user16324008
  • 1
  • 1
  • 2

2 Answers2

1

You can use the Onload function. onLoad is called once your page has fired its load event. All of the scripts, stylesheets, html and other resources are guaranteed to be available at this point.

Link: https://docs.cypress.io/api/commands/visit#Options

  onLoad: (contentWindow) => {
    // contentWindow is the remote page's window object
    if (contentWindow.angular) {
      // do something
    }
  },
})```  
Félix Pujols
  • 107
  • 1
  • 7
-1

The answer is - this website use Akamai Bot Management

user16324008
  • 1
  • 1
  • 2