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()
selffunction create(): self
fromEnv()
selffunction fromEnv(): self
withNodePath()
selffunction withNodePath(?string $path): self
withMinNodeVersion()
selffunction withMinNodeVersion(string $version): self
withBrowser()
selffunction withBrowser(BrowserType $browser): self
withChannel()
selffunction withChannel(?string $channel): self
withHeadless()
selffunction withHeadless(bool $headless): self
withTimeoutMs()
selffunction withTimeoutMs(int $timeoutMs): self
withSlowMoMs()
selffunction withSlowMoMs(int $slowMoMs): self
withArgs()
selffunction withArgs(array $args): self
addArg()
selffunction addArg(string $arg): self
withEnv()
selffunction withEnv(array $env): self
addEnv()
selffunction addEnv(string $key, string $value): self
withDownloadsDir()
selffunction withDownloadsDir(?string $dir): self
withVideosDir()
selffunction withVideosDir(?string $dir): self
withTracing()
selffunction withTracing(bool $enabled, ?string $traceDir = null, bool $screenshots = true, bool $snapshots = true): self
withProxy()
selffunction withProxy(?string $server, ?string $username = null, ?string $password = null, ?string $bypass = null): self
withLogger()
selffunction withLogger(?LoggerInterface $logger): self
build()
PlaywrightConfigfunction build(): PlaywrightConfig