All skills
openai avatar

/playwright

@2d665c9 official
by openaiopenai/skills28k stars
1,891

Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.

Use this Skill: https://skilld.dev/gh/openai/skills/playwright

This session only. Nothing lands on disk.

referencescli.md

≈466 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Playwright CLI Reference

Use the wrapper script unless the CLI is already installed globally:

export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
export PWCLI="$CODEX_HOME/skills/playwright/scripts/playwright_cli.sh"
"$PWCLI" --help

User-scoped skills install under $CODEX_HOME/skills (default: ~/.codex/skills).

Optional convenience alias:

alias pwcli="$PWCLI"

Core

pwcli open https://example.com
pwcli close
pwcli snapshot
pwcli click e3
pwcli dblclick e7
pwcli type "search terms"
pwcli press Enter
pwcli fill e5 "user@example.com"
pwcli drag e2 e8
pwcli hover e4
pwcli select e9 "option-value"
pwcli upload ./document.pdf
pwcli check e12
pwcli uncheck e12
pwcli eval "document.title"
pwcli eval "el => el.textContent" e5
pwcli dialog-accept
pwcli dialog-accept "confirmation text"
pwcli dialog-dismiss
pwcli resize 1920 1080

Navigation

pwcli go-back
pwcli go-forward
pwcli reload

Keyboard

pwcli press Enter
pwcli press ArrowDown
pwcli keydown Shift
pwcli keyup Shift

Mouse

pwcli mousemove 150 300
pwcli mousedown
pwcli mousedown right
pwcli mouseup
pwcli mouseup right
pwcli mousewheel 0 100

Save as

pwcli screenshot
pwcli screenshot e5
pwcli pdf

Tabs

pwcli tab-list
pwcli tab-new
pwcli tab-new https://example.com/page
pwcli tab-close
pwcli tab-close 2
pwcli tab-select 0

DevTools

pwcli console
pwcli console warning
pwcli network
pwcli run-code "await page.waitForTimeout(1000)"
pwcli tracing-start
pwcli tracing-stop

Sessions

Use a named session to isolate work:

pwcli --session todo open https://demo.playwright.dev/todomvc
pwcli --session todo snapshot

Or set an environment variable once:

export PLAYWRIGHT_CLI_SESSION=todo
pwcli open https://demo.playwright.dev/todomvc

Source: SKILL.md on GitHub

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill includes some security considerations such as terminal command execution and an indirect prompt injection surface inherent to browser automation workflows. While these areas warrant review, they are standard components of the skill's intended functionality for web interaction.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    7/7 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2d665c9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 8 months ago
  • CLI
  • Debugging
  • playwright
  • browser-automation
  • e2e-testing
  • web-scraping
  • form-filling
  • screenshots

README badge

README badge for openai/skills/playwright

Automates browser navigation, form filling, screenshots, and data extraction via `playwright-cli`, using a wrapper script that works without a global install. Targets terminal-driven UI automation and debugging workflows, not test file generation.

Generated from the current SKILL.md.

Does this skill use Playwright Test, or just the CLI?
It uses the Playwright CLI for terminal-driven automation. Test files are not the default; use this for navigation, form filling, screenshots, and UI debugging via `playwright-cli` commands.
Do I need to install Playwright globally?
No. The bundled wrapper script uses `npx` to run `@playwright/cli` without a global install. A global install is optional if your repo already standardizes on it.
What do I need to have installed before using this skill?
Node.js and npm (which provide `npx`). If missing, install Node.js, then you can proceed with the wrapper script.
How do I reference elements after taking a snapshot?
Snapshot generates stable element refs like `e1`, `e2`, `e3`. Use these refs in click, fill, and other interaction commands. Re-snapshot if refs become stale after navigation or DOM changes.
Can I use this skill to debug UI flows?
Yes. Use the `--headed` flag to open a visible browser, and `tracing-start` / `tracing-stop` to capture execution traces for debugging.

Generated from the current SKILL.md. These answers refresh after source changes.