Webapp Testing
Prerequisites
Requires Playwright MCP server configured in mcp.json, or Playwright installed locally.
Commands
- •
/webtest <description>— Generate and run a test from a plain English description - •
/webtest record <url>— Open a browser and record user actions as a test - •
/webtest run <file>— Run an existing test file - •
/webtest report— Show results from the last test run
Procedure
Phase 1: Understand the Flow
Parse the user's plain English description into test steps:
Input: "Log in with test credentials, navigate to settings, change the display name, verify it saved"
Output steps:
- •Navigate to login page
- •Fill email and password fields
- •Click login button
- •Wait for dashboard to load
- •Click settings link
- •Clear display name field
- •Type new display name
- •Click save button
- •Verify success message appears
- •Verify display name updated
Phase 2: Generate Test
Write a Playwright test spec:
typescript
import { test, expect } from '@playwright/test';
test('update display name in settings', async ({ page }) => {
await page.goto('/login');
await page.fill('[name="email"]', process.env.TEST_EMAIL);
await page.fill('[name="password"]', process.env.TEST_PASSWORD);
await page.click('button[type="submit"]');
await page.waitForURL('/dashboard');
// ... remaining steps
});
Phase 3: Run
Execute the test using either:
- •Playwright MCP server (browser_navigate, browser_click, browser_fill_form, etc.)
- •Local Playwright CLI:
npx playwright test
Phase 4: Report
For each test:
- •Status: PASS / FAIL
- •Duration
- •Screenshots on failure
- •Error details with line reference
- •Suggested fix if failed
Test Patterns
- •Login flows
- •Form submissions
- •Navigation and routing
- •CRUD operations
- •Error state handling
- •Responsive layout verification
MCMAP Usage
Primary test targets:
- •Power Apps portal pages
- •Copilot Studio web chat widget
- •SharePoint document libraries
- •Dataverse model-driven apps (via browser automation)
Safety Rules
- •Never use production credentials in tests — use test/sandbox accounts only
- •Never modify production data — always target sandbox environments
- •Store test credentials in environment variables, never in test files