@zuke/playwright

← API reference

`@zuke/playwright` — typed `PlaywrightTasks` wrappers for the Playwright CLI,

Symbols

# PlaywrightCodegenSettings class
class PlaywrightCodegenSettings extends PlaywrightSettings

Settings for playwright codegen.

MemberSignatureDoc
url url(value: string): this The URL to open for recording; omit to start blank.
target target(language: string): this The output language (--target=, e.g. javascript, python).
output output(path: string): this Write the generated script to a file (--output=).
# PlaywrightInstallSettings class
class PlaywrightInstallSettings extends PlaywrightSettings

Settings for playwright install (browser binaries).

MemberSignatureDoc
browsers browsers(...names: string[]): this Browsers to install (e.g. chromium); omit to install all.
withDeps withDeps(): this Also install the OS dependencies (--with-deps).
# PlaywrightSettings class
class PlaywrightSettings extends ToolSettings

Base for all Playwright subcommand settings: binary is playwright.

# PlaywrightShowReportSettings class
class PlaywrightShowReportSettings extends PlaywrightSettings

Settings for playwright show-report.

MemberSignatureDoc
dir dir(path: string): this The report directory to open; omit for the default.
# PlaywrightTasks const
const PlaywrightTasks: PlaywrightTasksApi

Typed task functions for the Playwright CLI.

# PlaywrightTasksApi interface
interface PlaywrightTasksApi

The shape of PlaywrightTasks.

MemberSignatureDoc
test test(configure?: Configure<PlaywrightTestSettings>): Promise<CommandOutput> Run the test suite: playwright test.
install install(configure?: Configure<PlaywrightInstallSettings>): Promise<CommandOutput> Install browser binaries: playwright install.
showReport showReport(configure?: Configure<PlaywrightShowReportSettings>): Promise<CommandOutput> Open the HTML report: playwright show-report.
codegen codegen(configure?: Configure<PlaywrightCodegenSettings>): Promise<CommandOutput> Record interactions into a script: playwright codegen.
# PlaywrightTestSettings class
class PlaywrightTestSettings extends PlaywrightSettings

Settings for playwright test.

MemberSignatureDoc
project project(...names: string[]): this Restrict to the named project(s) (--project=); repeatable.
grep grep(pattern: string): this Only run tests matching the pattern (--grep).
headed headed(): this Run in headed browsers (--headed).
ui ui(): this Open the interactive UI mode (--ui).
workers workers(count: number): this Set the number of parallel workers (--workers=).
reporter reporter(name: string): this Choose the reporter (--reporter=).
updateSnapshots updateSnapshots(): this Update snapshots instead of failing on a mismatch (--update-snapshots).
config config(path: string): this Use a specific config file (--config=).
paths paths(...filters: string[]): this Test file or directory filters to run; omit to run all tests.