Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
This skill enables comprehensive testing and debugging of local web applications using Playwright automation.
You should use the Playwright MCP Server to undertake the work if possible. If the MCP Server is unavailable, you can run the code in a local Node.js environment with Playwright installed.
Use this skill when you need to:
// Navigate to a page and verify title
await page.goto("http://localhost:3000");
const title = await page.title();
console.log("Page title:", title);
// Fill out and submit a form
await page.fill("#username", "testuser");
await page.fill("#password", "password123");
await page.click('button[type="submit"]');
await page.waitForURL("**/dashboard");
// Capture a screenshot for debugging
await page.screenshot({ path: "debug.png", fullPage: true });
await page.waitForSelector("#element-id", { state: "visible" });
const exists = (await page.locator("#element-id").count()) > 0;
page.on("console", (msg) => console.log("Browser log:", msg.text()));
try {
await page.click("#button");
} catch (error) {
await page.screenshot({ path: "error.png" });
throw error;
}
Some helper functions are available in test-helper.js to simplify common tasks like waiting for elements, capturing screenshots, and handling errors. You can import and use these functions in your tests to improve readability and maintainability.