chris aimsworth
chris aimsworth

Reputation: 95

How do I set the pageloadtimeout in Cypress?

How do I set the pageloadtimeout in the cypress.config.js file? There is this link Documentation, but I am not sure where to place the pageloadtimeout in the file.

I have tried pasting it in the file and it gave me errors. I think it was because I didn't place it in the right place.

Upvotes: 2

Views: 995

Answers (1)

Bob.B.Harris
Bob.B.Harris

Reputation: 58

If you search the page for pageLoadTimeout, the first instance comes up in the section Global (see the page index on the right).

That means you place the option outside the e2e or component section.

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  pageLoadTimeout: 70_000,
  e2e: {
    baseUrl: 'http://localhost:1234'
  }
})

Upvotes: 4

Related Questions