PlaywrightExtension

Playwright\Symfony\DependencyInjection\PlaywrightExtension

$ composer require playwright-php/playwright-symfony

Methods

load()

void

When "playwright.enabled" is false, no service and no parameter is registered: services.php references playwright.* parameters that are only set below, so loading it for a disabled bundle would break container compilation.

function load(array $configs, ContainerBuilder $container): void

getAlias()

string
function getAlias(): string

createBrowserContext()

BrowserContextInterface

DI factory for browser context services. The whole PlaywrightConfig flows into the library: node_path, env and timeout_ms reach the Node.js server transport, headless, slowmo_ms and args reach the browser launch, screenshot_dir is used at runtime.

function createBrowserContext(PlaywrightConfig $config): BrowserContextInterface