Getting started¶
This walks through launching a browser, opening a page, navigating to a local file, and tearing everything down.
Start the driver¶
WWW::Playwright.start spawns the Node sidecar and returns a driver handle.
1 2 3 | |
Launch a browser¶
launch starts Chromium. It is headless by default; pass :!headless to see a
window.
1 2 | |
Open a context and a page¶
A context is an isolated browser session, the right boundary for one test. Each context owns its own pages.
1 2 | |
Navigate¶
goto returns the HTTP status of the navigation response.
1 2 | |
Tear down¶
Close from the inside out, then stop the sidecar.
1 2 3 4 5 | |
stop closes the sidecar's stdin, which closes any browser the sidecar still
holds before the Node process exits.