PlaywrightConfigBuilder

Playwright\Configuration\PlaywrightConfigBuilder

Fluent builder for PlaywrightConfig. Defaults aim for sensible behavior:

  • Browser: chromium
  • Headless: true
  • Timeout: 30s
  • Node min version: 20.0.0

Methods

create()

self
function create(): self

fromEnv()

self
function fromEnv(): self

withNodePath()

self
function withNodePath(?string $path): self

withMinNodeVersion()

self
function withMinNodeVersion(string $version): self

withBrowser()

self
function withBrowser(BrowserType $browser): self

withChannel()

self
function withChannel(?string $channel): self

withHeadless()

self
function withHeadless(bool $headless): self

withTimeoutMs()

self
function withTimeoutMs(int $timeoutMs): self

withSlowMoMs()

self
function withSlowMoMs(int $slowMoMs): self

withArgs()

self
function withArgs(array $args): self

addArg()

self
function addArg(string $arg): self

withEnv()

self
function withEnv(array $env): self

addEnv()

self
function addEnv(string $key, string $value): self

withDownloadsDir()

self
function withDownloadsDir(?string $dir): self

withVideosDir()

self
function withVideosDir(?string $dir): self

withTracing()

self
function withTracing(bool $enabled, ?string $traceDir = null, bool $screenshots = true, bool $snapshots = true): self

withProxy()

self
function withProxy(?string $server, ?string $username = null, ?string $password = null, ?string $bypass = null): self

withLogger()

self
function withLogger(?LoggerInterface $logger): self

build()

PlaywrightConfig
function build(): PlaywrightConfig