Form Interaction Testing with MCP Playwright
You are a QA engineer testing form interactions in a React TypeScript web application using the MCP Playwright server.
Prerequisites
- •The app must be running at
http://localhost:3000(or ask the user for the URL) - •If the app is not reachable, inform the user and stop
Setup
bash
mkdir -p test-reports
How to interact with forms via MCP Playwright
- •
browser_snapshot-> returns accessibility tree withrefvalues for each element - •
browser_type-> types text into an input identified by itsref - •
browser_click-> clicks a button/link identified by itsref - •After each action, take a new
browser_snapshotto see the updated state (new errors, changed values, redirects)
Instructions
Step 1 — Discover all forms
- •
browser_navigatetohttp://localhost:3000 - •
browser_snapshot— identify all pages from links - •Navigate to each page and identify forms (look for
textbox,buttonroles)
Step 2 — Test the Login form (/login)
Test 2a — Empty submission:
- •
browser_snapshotto get the Submit buttonref - •
browser_clickon the Sign in button - •
browser_snapshotto check for validation error messages
Test 2b — Invalid email:
- •
browser_typeon the email field:"not-an-email" - •
browser_typeon the password field:"password123" - •
browser_clickon Sign in - •
browser_snapshotto verify "Invalid email" error appears
Test 2c — Valid login:
- •Navigate back to
/loginto reset the form - •
browser_typeon email:"test@bank.com" - •
browser_typeon password:"password123" - •
browser_clickon Sign in - •
browser_snapshotto verify redirect to Dashboard
Step 3 — Test the Register form (/register)
Test 3a — Empty submission:
- •
browser_navigateto/register - •
browser_clickon Create account button - •
browser_snapshotto verify validation errors
Test 3b — Password mismatch:
- •
browser_navigateto/register(reset form) - •
browser_typeon Full name:"Test User" - •
browser_typeon Email:"newuser@test.com" - •
browser_typeon Password:"password123" - •
browser_typeon Confirm password:"differentpass" - •
browser_clickon Create account - •
browser_snapshotto verify "Passwords must match" error
Test 3c — Valid registration:
- •
browser_navigateto/register(reset form) - •
browser_typeon Full name:"New User" - •
browser_typeon Email:"newuser@test.com" - •
browser_typeon Password:"SecurePass123" - •
browser_typeon Confirm password:"SecurePass123" - •Accept terms if checkbox exists
- •
browser_clickon Create account - •
browser_snapshotto verify success (redirect to dashboard or success message)
Output
Write the report to test-reports/form-interaction-report.md:
| # | Form | Test Case | Input | Expected | Actual | Status |
|---|---|---|---|---|---|---|
| 2a | Login | Empty submit | none | Validation errors | ... | Pass/Fail |
| 2b | Login | Invalid email | not-an-email | Email error | ... | Pass/Fail |
| 2c | Login | Valid login | test@bank.com | Dashboard redirect | ... | Pass/Fail |
| 3a | Register | Empty submit | none | Validation errors | ... | Pass/Fail |
| 3b | Register | Password mismatch | differentpass | Mismatch error | ... | Pass/Fail |
| 3c | Register | Valid register | valid data | Success | ... | Pass/Fail |
Summary:
- •Forms tested: 2
- •Test cases: X passed / Y failed
- •Critical issues found
Tip: Run the
publish-reportsskill to publish this report to GitHub Pages.