PlaywrightManager
Playwright\Behat\PlaywrightManager
Owns the Playwright client and browser for the whole Behat run and hands
out one isolated page per scenario.
The browser is launched on first use and kept until shutdown(). Each page
lives in its own browser context, so cookies and storage never leak from
one scenario to the next.
Methods
__construct()
function __construct(private readonly array $config)
getConfig()
arrayfunction getConfig(): array
getTimeout()
intTimeout in milliseconds for browser actions and navigations.
function getTimeout(): int
getBrowser()
BrowserInterfacefunction getBrowser(): BrowserInterface
hasPage()
boolfunction hasPage(): bool
getPage()
PageInterfaceReturns the page of the current scenario, opening it on first call.
function getPage(): PageInterface
closePage()
voidCloses the current scenario page and its browser context.
function closePage(): void
saveScreenshot()
stringSaves a screenshot of the current page under the configured directory.
function saveScreenshot(string $name): string
getScreenshotDir()
stringfunction getScreenshotDir(): string
shutdown()
voidCloses the page, the browser and the Playwright client.
function shutdown(): void