@zuke/playwright
`@zuke/playwright` — typed `PlaywrightTasks` wrappers for the Playwright CLI,
@zuke/playwright on JSR ↗ 7 symbols
Symbols
class PlaywrightCodegenSettings extends PlaywrightSettings Settings for playwright codegen.
| Member | Signature | Doc |
|---|---|---|
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=). |
class PlaywrightInstallSettings extends PlaywrightSettings Settings for playwright install (browser binaries).
| Member | Signature | Doc |
|---|---|---|
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). |
class PlaywrightSettings extends ToolSettings Base for all Playwright subcommand settings: binary is playwright.
class PlaywrightShowReportSettings extends PlaywrightSettings Settings for playwright show-report.
| Member | Signature | Doc |
|---|---|---|
dir | dir(path: string): this | The report directory to open; omit for the default. |
const PlaywrightTasks: PlaywrightTasksApi Typed task functions for the Playwright CLI.
interface PlaywrightTasksApi The shape of PlaywrightTasks.
| Member | Signature | Doc |
|---|---|---|
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. |
class PlaywrightTestSettings extends PlaywrightSettings Settings for playwright test.
| Member | Signature | Doc |
|---|---|---|
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. |