.local/skills/testing/SKILL.md
Run automated UI tests against your application using a Playwright-based testing subagent. Use after implementing features to verify they work correctly.
npx skillsauth add akhil151/dtpapp testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The runTest(testPlan) function launches a specialized Playwright-based testing subagent that:
End-to-end testing with runTest() can uncover bugs not discoverable through conventional testing methods like curl or unit tests.
A good test plan derives from a good contextual understanding of the application. Before writing your test plan:
If you just implemented a feature, you already have most of this context — use it immediately. If a test fails due to insufficient context, iterate and add more details. If stuck after multiple attempts, stop and ask the user for help.
runTest() for e2e validation; reserve unit tests for regressions and backend logic.curl or standard HTTP clients insteadRun UI tests against the application using an automated Playwright-based testing subagent.
Parameters:
testPlan (str, required): Description of what to test, including specific steps and expected outcomesrelevantTechnicalDocumentation (str, optional): Technical context like database schema, API routes, or component detailsdefaultScreenWidth (int, default 1280): Browser viewport width. For mobile, use 400 (Replit mobile webview compatible, only suggested).defaultScreenHeight (int, default 720): Browser viewport height. For mobile, use 720 (suggested).Returns: Dict with:
status: One of "success", "failure", "unable", "skipped", "blocked", or "error"message: Summary of what happened during testingtestOutput: Detailed test output and observationssubagentId: ID of the testing subagent (for reference)screenshots: List of relevant screenshot URLs (typically for failures)Example:
const result = await runTest({
testPlan: `
Test the user login flow:
1. [New Context] Create a new browser context
2. [Browser] Navigate to the login page (path: /login)
3. [Browser] Enter "[email protected]" in the email field
4. [Browser] Enter "password123" in the password field
5. [Browser] Click the "Sign In" button
6. [Verify]
- Assert redirect to the dashboard (path: /dashboard)
- Assert user name appears in the header
`,
relevantTechnicalDocumentation: `
- Login endpoint: POST /api/auth/login
- Dashboard route: /dashboard
- User name displayed in #user-header element
`
});
if (result.status === 'success') {
console.log("All tests passed!");
} else if (result.status === 'failure') {
console.log(`Tests failed: ${result.message}`);
for (const screenshot of result.screenshots) {
// You can save the screenshots and then open them to see them visually
console.log(`See screenshot: ${screenshot.url}`);
}
}
Batch multiple [Verify] checks on the same page together when no actions occur between them. But if [Browser], [API], or [DB] steps occur between verifications, keep them in separate [Verify] blocks — verifications should be read-only blocks without side effects.
For UI testing, explicitly include interactions like hover effects, dialogs, modals, tooltips, dropdowns, and animations — the testing agent sometimes needs special handling for these (e.g., being told to dismiss a dialog before clicking).
relevantTechnicalDocumentationThe testing environment uses the same development database as you and the user. The application is not in a fresh state — it may contain existing data from prior usage.
nanoid to avoid conflicts across test runs and with user data1. [New Context] Create a new browser context
2. [Browser] Navigate to the product page (path: /products)
3. [Browser] Click on the first product link
4. [Verify] Assert redirect to the product page (path: /product/${product1Id})
5. [Verify]
- Ensure the product title is not too big
- Ensure the overall color scheme is consistent with the rest of the page
- Assert there are more than one products
- Make sure the add to cart button is not hidden behind another element
- Assert the product name is "Product 1"
6. [Browser] For the next dialog, accept the dialog.
7. [Browser] Click add to cart
8. [Browser] Click on cart
9. [Verify] Assert redirect to the cart page (path: /cart)
10. [Verify] Assert cart has the product displayed
1. [New Context] Create a new browser context
2. [API] Create a new product by POST to the /api/products endpoint with a randomly generated product name (say ${product_name}), and price 100. Note the name and the id of the created product.
3. [Browser] Navigate to the product page (path: /products)
4. [Verify]
- Ensure there is at least one product displayed
- Assert the product name is "${product_name}"
- Assert the product price is 100
1. [New Context] Create a new browser context
2. [Browser] Navigate to the homepage (path: /)
3. [Browser] Enter a TODO list item with a randomly generated title ${nanoid(6)}. Note the title (say ${todo_title}) for future use.
4. [Browser] Click the add todo button
5. [Verify] Assert that the TODO list item is displayed with the title ${todo_title}
If the application uses a database and you need to inject data, set roles, or verify DB state during tests, see database-testing.md for how to use [DB] steps in test plans.
If the application uses Replit's OIDC auth (javascript_log_in_with_replit or python_log_in_with_replit in .replit), see replit-auth.md for how to configure login claims in test plans. It is not relevant for other auth providers or simple username/password auth.
If the application connects to external services, be mindful of side effects. Clean up resources created during tests, and limit notifications sent to third parties. Balance thorough testing with responsible use of external services.
tools
Manage application workflows including configuration, restart, and removal.
development
Search the web and fetch content from URLs. Use for real-time information, API documentation, and current events.
data-ai
Create reusable skills that extend agent capabilities. Use when the user asks to create a skill, teach you something reusable, or save instructions for future tasks.
testing
Search Replit documentation for platform features, pricing, deployments, and capabilities.