PlaywrightFactory

Playwright\PlaywrightFactory

Simple factory for standard Playwright usage. The recommended way to create PlaywrightClient instances.

php
$playwright = PlaywrightFactory::create();
$config = new PlaywrightConfig(headless: false, screenshotDir: '/screenshots');
$playwright = PlaywrightFactory::create($config, $logger);
$config = PlaywrightConfigBuilder::fromEnv()->build();
$playwright = PlaywrightFactory::create($config);

Methods

create()

PlaywrightClient
function create( PlaywrightConfig $config = new PlaywrightConfig(), LoggerInterface $logger = new NullLogger(), ): PlaywrightClient