Cypress · Middle · Question 64 of 77
What is onBeforeLoad in cy.visit useful for?
- 1Running code after the page has fully loaded
- 2Changing
windowbefore app scripts run, e.g. stubs - 3Choosing which browser loads the page
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.