playwright-cli_skill

This skill automates browser actions with playwright-cli to navigate pages, fill forms, capture screenshots, and extract data.
  • TypeScript
  • Official

3.7k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill microsoft/playwright-cli --skill playwright-cli

  • SKILL.md7.3 KB

Overview

This skill exposes a CLI that automates browser interactions using Playwright for testing, form filling, screenshots, and data extraction. It provides simple commands to open browsers, navigate pages, interact with elements, capture snapshots, and manage sessions and storage. Use it to quickly run repeatable UI workflows, debug pages, or generate artifacts without writing full scripts.

How this skill works

The CLI connects to a Playwright-controlled browser session and exposes commands that map to common Playwright actions: navigation, clicks, typing, file uploads, mouse and keyboard events, screenshots, PDFs, and snapshots of the page state. Each command updates and optionally saves a snapshot showing URL, title, and a YAML state artifact. The tool can start persistent profiles, manage multiple named sessions, mock network routes, and control DevTools features like tracing and video recording.

When to use it

  • Quickly reproduce manual browser steps without creating a test script
  • Fill and submit forms or extract text and attributes from pages
  • Capture screenshots, PDFs, or timed snapshots for documentation or debugging
  • Mock network responses or force resource failures during testing
  • Manage multiple browser sessions or persistent profiles for login workflows
  • Record interactions and generate Playwright code for test scaffolding

Best practices

  • Use snapshots (--filename) when artifacts are part of the workflow result to keep reproducible outputs
  • Start persistent profiles or state-save/state-load for authenticated flows to avoid repeated logins
  • Prefer element refs (e.g., e5) produced by snapshots to make interactions stable
  • Use route mocking for deterministic tests and to avoid external API rate limits
  • Use tracing and video recording for hard-to-debug flaky behavior
  • Run locally with npx if global binary is not available

Example use cases

  • Automated form submission: open page, fill fields, click submit, and snapshot results
  • Test a multi-tab workflow: open base page, open new tab, switch tabs, and capture state
  • Debug UI issues: interact with elements, open console and network panes, record a trace
  • Generate Playwright code: record manual steps and use generated selectors in tests
  • Run headless screenshots and PDFs for visual regression or reporting

FAQ

Open the browser with --persistent or use state-save/state-load to store and reuse authentication state files.

Can I mock API responses with the CLI?

Yes. Use route with patterns (e.g., --body or --status) to intercept requests, and unroute to remove mocks.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
playwright-cli skill by microsoft/playwright-cli | VeilStrat