Run a script's text in the page before any of its own scripts, on every load. The text form is the one Playwright's Page.addInitScript takes without serialising an argument, so a real page fits without a cast.
Close the page.
Load an address, resolving at the load event.
The browser page a draw session drives, declared as the five Playwright
Pagemethods it calls, so a Playwright page fits as it is and a test passes a recording double.Functions handed to
waitForFunctionandevaluaterun inside the page, so they read only their argument; the init script is text.