Cypress · Middle · Question 64 of 77

What is onBeforeLoad in cy.visit useful for?

Show the answer

Correct answer: Changing window before app scripts run, e.g. stubs

Explanation

It's the place to stub browser APIs like geolocation or set localStorage flags before the app reads them.

Further reading

Problem with a question

Cypress · Middle · question 64

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz