跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

playwright-testing

Use when a manual-QA agent does live browser testing through the Playwright MCP server — exploring/profiling a web app or executing a web test case against a running app, with no test code generated. Web/PWA/hybrid targets; used by app-profiler and test-runner. Mobile native → use mobile-testing instead.

arozumenko · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add arozumenko/sdlc-skills --skill playwright-testing

技能说明


name: playwright-testing description: Use when a manual-QA agent does live browser testing through the Playwright MCP server — exploring/profiling a web app or executing a web test case against a running app, with no test code generated. Web/PWA/hybrid targets; used by app-profiler and test-runner. Mobile native → use mobile-testing instead. license: Apache-2.0 compatibility: Requires Node.js 18+. Playwright MCP server (@playwright/mcp) installed via setup.yaml. metadata: authors: - Artem Rozumenko artem_rozumenko@epam.com version: "0.3.0"

Playwright Testing (live, via MCP)

Live browser testing for the manual-QA team. You drive a real browser through the Playwright MCP server (@playwright/mcp) to explore a web app or execute a test case step-by-step against a running app. You never write or run Playwright test code — no Page Object Model, no pytest, no .spec.ts files. The output is a verdict plus evidence, not a test suite.

Writing actual Playwright test code is test-automation-engineer's job (a different factory's copy of this skill). Here, the browser is your hands.

When to use

  • app-profiler — explore a running web app: map key flows, capture reliable selectors and fragile areas into app_profile.md.
  • test-runner — execute one web TC-NNN case live: run each step, verify, collect evidence, return a structured result.
  • Web / PWA / hybrid only. Native iOS/Android → use the mobile-testing skill. (PWA/hybrid with a mobile viewport is still this skill.)

Core loop — snapshot first

The Playwright MCP exposes browser_* tools. The loop for every check:

  1. browser_navigate(url) — go to {{base_url}}/path (substitute base_url from the run prompt). Navigation auto-waits for load.
  2. browser_snapshot() — the accessibility snapshot gives each element a target ref plus its role and accessible name. You need the ref before you can act, and role/name is what you assert on.
  3. Act by passing that ref as target (plus a short human-readable element description): browser_click, browser_type, browser_fill_form, browser_select_option, browser_press_key, browser_hover.
  4. browser_wait_for({text}) / ({textGone}) — wait for the expected text to appear, or a spinner/loader text to disappear, before continuing.
  5. browser_snapshot() again, then collect evidence: browser_take_screenshot, browser_console_messages, browser_network_requests.

Refs go stale. Every target ref comes from the latest snapshot — after any navigation or DOM change, re-browser_snapshot before acting again. The server is versioned; this skill is written against the browser_* toolset and parameter names can shift between @playwright/mcp releases.

MCP tool quick reference

ToolKey params (* = required)Use
browser_navigateurl*Go to a URL
browser_snapshot—Accessibility snapshot → element refs (target) + roles/names
browser_clickelement, target*, doubleClick, buttonClick an element
browser_typeelement, target*, text*, submit, slowlyType into one field (submit:true presses Enter after)
browser_fill_formfields*Fill many fields in one call (see below)
browser_select_optionelement, target*, values*Pick option(s) in a native <select>
browser_press_keykey*Press a key (Enter, Escape, ArrowDown, a)
browser_hoverelement, target*Hover
browser_wait_fortext / textGone / timeWait for text to appear / disappear / N seconds
browser_take_screenshottype* (png|jpeg), filename, fullPageCapture evidence
browser_console_messageslevel* (error|warning|info|debug)Read console (use level:"error")
browser_network_requestsstatic*, filterList network calls
browser_handle_dialogaccept*, promptTextAccept/dismiss a native JS dialog/alert
browser_file_uploadpathsUpload file(s) into a file chooser
browser_navigate_back · browser_tabs · browser_resize—Back · tab mgmt · viewport

target* is the ref from the latest browser_snapshot (a unique CSS selector also works); always pass element too — a short description of what you're acting on.

{{base_url}} rule

All test-case URLs are written {{base_url}}/path. Substitute the real base URL from the run prompt into the browser_navigate(url) call at execution time — this keeps cases environment-agnostic across dev / staging / prod.

Filling a form (one call)

browser_fill_form fills every field in a single call. Each field is {element, target, name, type, value}, where type ∈ textbox | checkbox | radio | combobox | slider (checkbox/radio value is "true"/"false"; combobox value is the option text):

browser_snapshot()                       # get refs first
browser_fill_form(fields=[
  {element:"Email field",    target:"<ref>", name:"Email",    type:"textbox",  value:"qa@example.com"},
  {element:"Password field", target:"<ref>", name:"Password", type:"textbox",  value:"Passw0rd!"},
  {element:"Remember me",    target:"<ref>", name:"Remember", type:"checkbox", value:"true"},
])

For a single field, browser_type(element, target, text, submit:true) types and presses Enter in one step.

Mapping test-case steps to MCP tools

Test cases are written in plain language. Map each step verb to a tool call:

TC step verbMCP tool call
Open / Go to Xbrowser_navigate(url:"{{base_url}}/…")
Click / Tap Xbrowser_click(element, target)
Enter V in field Fbrowser_type(element, target, text:"V") — or browser_fill_form for several
Select O from Dbrowser_select_option(element, target, values:["O"])
Press Kbrowser_press_key(key:"K")
Hover over Xbrowser_hover(element, target)
Verify / See X`brow
阅读完整来源 ↗