Logo Playwright Testing

Playwright Testing

Cộng đồng
arozumenko
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.

Tổng quan

Nhà phát hànharozumenko
Kho mãsdlc-skills
Tên kỹ năngplaywright-testing
Sao
26
Bản fork
10
Tệp đi kèm
2
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được arozumenko công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Playwright Testing trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/arozumenko/sdlc-skills/tree/main/bundles/feature-development/skills/playwright-testing
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/arozumenko/sdlc-skills.git /tmp/sdlc-skills
mkdir -p .claude/skills
cp -r /tmp/sdlc-skills/bundles/feature-development/skills/playwright-testing .claude/skills/playwright-testing
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Playwright Testing trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Playwright Testing ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Playwright Testing không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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 Xbrowser_snapshot() then assert the role/name — or browser_wait_for(text:"X")
Take a screenshotbrowser_take_screenshot(type:"png", filename:"…")
Upload filebrowser_file_upload(paths:["…"])
Dismiss alert/confirmbrowser_handle_dialog(accept:true)

Selecting elements from the snapshot

browser_snapshot returns each interactive element with a target ref and its role + accessible name. Prefer, in order: the snapshot's role + accessible name → data-testid → visible text → a stable selector. Avoid brittle positional CSS (nth-child, deep descendant chains). When a clean ref isn't obvious, a unique CSS selector passed as target is valid. Framework-specific selector hints (MUI, shadcn/ui, Ant Design) and gotchas: references/patterns.md.

Waiting

browser_navigate and the action tools auto-wait for the page/element. For app-side state, use browser_wait_for — never a fixed sleep when a condition works:

SituationCall
Expected content appearsbrowser_wait_for(text:"Welcome back")
Spinner / loader clearsbrowser_wait_for(textGone:"Loading…")
Nothing observable to key onbrowser_wait_for(time:1) — last resort

Evidence and verification before PASS

  • browser_take_screenshot(type:"png", filename:"reports/screenshots/{TC_ID}_{YYYY-MM-DD}.png") — visual proof. (Filenames are relative to the MCP output dir.)
  • browser_console_messages(level:"error") — check for silent JS errors even when the UI looks fine; they're the worst bugs. browser_network_requests confirms the API calls actually fired.
  • Verify the Expected Final State in a final browser_snapshot before recording PASS. A PASS without a confirming snapshot of the expected state is invalid (apply verification-before-completion).

Failure handling

On a mismatch, apply systematic-debugging:

  1. browser_snapshot + browser_take_screenshot — capture evidence first.
  2. State actual vs expected ("Login screen still visible; expected Dashboard").
  3. Retry once with a better target (different selector strategy).
  4. Still failing → record FAIL with a snapshot excerpt in failure_reason.

Result hand-off

When run by test-runner inside a led suite, end the response with the single structured JSON result block the test-run-lead collects (tc_id, result PASS/FAIL/BLOCKED, steps, screenshot, failure_reason, …). The lead and test-reporter consume that block — see the test-runner agent for the exact schema.

Bug report format

When you find an issue (outside a structured run):

## [SEVERITY] Title
Steps: 1. Navigate to… 2. Click… 3. Observe…
Expected: what should happen
Actual: what happens
Evidence: screenshot, console error, network response
Frequency: Always / Intermittent / Once

Reference

references/patterns.md — live interaction recipes (login, forms, dialogs, dropdowns, file upload) as exact browser_* call chains, framework-specific selector hints, and common gotchas.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Playwright Testing làm được gì?

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.

Vì sao nên dùng Playwright Testing trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Playwright Testing là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Playwright Testing trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/arozumenko/sdlc-skills/tree/main/bundles/feature-development/skills/playwright-testing. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Playwright Testing?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Playwright Testing với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Playwright Testing với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Playwright Testing có miễn phí không?

Có. Kỹ năng này được arozumenko phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇