k11 Playwright QA
v0.4.2User stories to verified Playwright tests, and self-healing locators with an audit trail.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
explore_page Explore page
Open a URL in a headless browser (optionally with a saved login and/or steps to reach a deeper page) and list its meaningful elements with locators verified to match exactly one element, most stable first. Use these locators when writing tests instead of guessing selectors.
| Parameter | Type | Description |
|---|---|---|
url * | string | Start URL (http, https or file) |
device | string | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) |
interactive_only | boolean | Only buttons, links, inputs and other controls |
max_elements | integer | |
session | object | Reach pages behind a login or several steps into a flow |
check_locator Check locator
Check how many elements a Playwright locator matches on a page (1 = good) and whether the match is visible. Accepts the same session as explore_page.
| Parameter | Type | Description |
|---|---|---|
locator * | string | e.g. page.getByRole('button', { name: 'Sign in' }) |
url * | string | |
device | string | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) |
devices | array | Check on several devices at once, e.g. ["desktop", "iPhone 15", "Pixel 7"] |
session | object | Reach pages behind a login or several steps into a flow |
save_login_state Save login state
Log in once by running steps on a login page, then save the browser's cookies and storage to .qa-mcp/auth/<name>.json. Pass that file as session.storage_state to other tools, or to Playwright's storageState in tests. Put passwords in environment variables and reference them as ${ENV:NAME}; never pass them literally. The saved file contains session tokens: keep .qa-mcp/auth out of version control.
| Parameter | Type | Description |
|---|---|---|
steps * | array | |
url * | string | Login page URL |
device | string | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) |
name | string | |
success_locator | string | Locator that must be visible after login, e.g. page.getByRole('heading', { name: 'My account' }) |
review_user_story Review user story before testing
Call this BEFORE parse_user_story. Finds what a careful tester would ask before writing tests: missing acceptance criteria, outcomes that can't be asserted, no user role, untestable words (fast, easy, many), limits without numbers, no failure path, missing preconditions, and (with context) terms the context never explains. Returns questions for a person to answer, each with why it matters and the words that raised it. If ready is false, ask the user these questions and wait; do not guess the answers.
| Parameter | Type | Description |
|---|---|---|
story * | string | |
context | string | Related product docs, glossary or notes; terms the story uses but this never explains become questions |
parse_user_story Parse user story
Turn a user story (As a.../I want.../so that..., Gherkin scenarios, or acceptance-criteria bullets) into structured scenarios and a Playwright Test skeleton with one test per scenario and one test.step per step. Call review_user_story first; the result includes a short review so open questions are never silently skipped.
| Parameter | Type | Description |
|---|---|---|
story * | string | |
url | string | Start page, added as page.goto in beforeEach |
write_test Write test file
Write a Playwright spec into the project's tests/ folder. Refuses paths outside tests/ and will not overwrite unless overwrite=true.
| Parameter | Type | Description |
|---|---|---|
code * | string | |
path * | string | Relative to tests/, e.g. login.spec.ts |
overwrite | boolean |
run_tests Run Playwright tests
Run Playwright Test in the project and return per-test results. Failures include the error, its location and, when the cause was a locator, the locator Playwright was waiting for (pass it to heal_locator).
| Parameter | Type | Description |
|---|---|---|
grep | string | Only run tests whose title matches |
project | string | Only this Playwright project from playwright.config, e.g. "Mobile Safari"; omit to run all projects |
spec | string | Spec file relative to tests/; omit to run everything |
capture_baseline Capture locator baselines
While tests pass, record a fingerprint (role, name, test id, id, classes, text...) of the element each locator matches, saved in .qa-mcp/baselines.json under the page reached. heal_locator uses these after the UI changes. Accepts the same session as explore_page for pages behind a login.
| Parameter | Type | Description |
|---|---|---|
locators * | array | |
url * | string | |
device | string | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) |
session | object | Reach pages behind a login or several steps into a flow |
heal_locator Heal locator
For a locator that no longer matches (or matches several elements), find the most likely intended element on the current page and suggest a verified replacement with a confidence score and reasons. Accepts the same session as explore_page. Never edits files: review the suggestion, update the test, then re-run.
| Parameter | Type | Description |
|---|---|---|
locator * | string | |
url * | string | |
check_devices | array | Also verify the suggestion on these devices, e.g. ["desktop", "iPhone 15"], so a mobile fix does not break desktop |
device | string | Emulate a device for mobile web: a Playwright device name such as "iPhone 15" or "Pixel 7" (list_devices), or "desktop" (default) |
session | object | Reach pages behind a login or several steps into a flow |
list_devices List devices
Device profiles for mobile web testing (Playwright's built-in list): phones and tablets with their screen size, pixel density and touch. Pass a name as device to explore_page, check_locator, capture_baseline and heal_locator.