Run end-to-end tests and manual QA using Playwright MCP to verify recently implemented features.
Workflow
1. Identify the Task to Test
Before running any test, review the history of the current conversation to identify the last completed task:
Busca en los mensajes recientes:
- Tareas marcadas como "completadas" o "done"
- Implementaciones finalizadas
- Features agregadas o modificadas
- Bug fixes aplicados
If you cannot clearly identify the task, ask the user: "What functionality or flow should I test?"
2. Find Test Credentials
ALWAYS before attempting login, look for test credentials:
# Buscar archivo de credenciales en el proyecto
Get-ChildItem -Path . -Filter "CREDENTIALS.md" -Recurse
Common locations:
CREDENTIALS.md(project root)docs/CREDENTIALS.md.credentials/CREDENTIALS.mdtesting/CREDENTIALS.md
Expected format in CREDENTIALS.md:
## Usuario Admin
- Email: admin@test.com
- Password: admin123
## Usuario Regular
- Email: user@test.com
- Password: user123
If you do NOT find CREDENTIALS.md:
- Stop and ask the user for the credentials
- Do NOT try to guess or use generic credentials
3. Connect to the Application
Try to connect to the default port:
# Verificar si puerto 5173 esta en uso
Test-NetConnection -ComputerName 127.0.0.1 -Port 5173 -InformationLevel Quiet
- If port 5173 is busy: Use that connection
- If port 5173 is NOT in use:
- Check whether there is another common port (3000, 4200, 8080)
- If there is no active port, ask the user
4. Pre-Test Confirmation (MANDATORY)
Before running any test, present to the user:
## Plan de Prueba
**Tarea identificada**: [descripcion de la tarea completada]
**Flujo a probar**:
1. [Paso 1]
2. [Paso 2]
3. [Paso 3]
**Credenciales a usar**: [rol/usuario del CREDENTIALS.md]
**URL de inicio**: http://127.0.0.1:[puerto]
¿Procedo con esta prueba? (s/n)
Do NOT proceed until you receive explicit confirmation from the user.
If the user rejects:
- Ask what should be done differently
- Adjust the plan according to their instructions
- Ask for confirmation again
5. Run the Test
Once confirmed, use Playwright MCP to run the test:
Start Browser (headless)
playwright_browser_navigate con url http://127.0.0.1:[puerto]
If Login is required
- Take a snapshot to see the current state
- Identify email/username and password fields
- Fill out the form with credentials from CREDENTIALS.md
- Submit the form
- Verify successful login (snapshot, look for success element)
Run Test Flow
- Navigate to the target functionality
- Interact with elements according to the identified flow
- Take snapshots at key points
- Verify expected results
Useful Playwright Commands
| Action | Tool |
|---|---|
| View current state | playwright_browser_snapshot |
| Navigate | playwright_browser_navigate |
| Click | playwright_browser_click |
| Type text | playwright_browser_type |
| Select dropdown | playwright_browser_select_option |
| Fill form | playwright_browser_fill_form |
| Wait | playwright_browser_wait_for |
| Screenshot | playwright_browser_take_screenshot |
6. Report Results
When finished, present a clear report:
## Resultado de Prueba E2E
**Estado**: [PASO / FALLO]
**Tarea probada**: [descripcion]
**Pasos ejecutados**:
1. [Paso 1] - [OK/FALLO: razon]
2. [Paso 2] - [OK/FALLO: razon]
3. [Paso 3] - [OK/FALLO: razon]
**Resultado final**:
[Descripcion de que paso, si hubo errores, comportamiento observado]
**Evidencia**:
- [Screenshots tomados o pasos verificados]
Common Use Cases
Test New Form
- Identify form fields
- Fill in with valid test data
- Submit and verify successful response
- Test validations (empty fields, invalid formats)
Test Authentication Flow
- Verify login screen
- Use credentials from CREDENTIALS.md
- Verify post-login redirect
- Verify elements visible only to authenticated users
Test CRUD
- Create: Create new record, verify appearance in list
- Read: Verify data displayed correctly
- Update: Edit record, verify changes persisted
- Delete: Delete record, verify it disappears from list
Test Feature Toggle
- Verify state before activating feature
- Activate/trigger the feature
- Verify state afterward (UI visible, behavior changed)
Error Handling
If the application does not load
- Verify that the server is running
- Verify correct URL and port
- Report to the user
If login fails
- Verify credentials in CREDENTIALS.md
- Verify that the form has the correct fields
- Report specific error to the user
If an element is not found
- Take a snapshot to see the current state
- Look for alternative selectors
- If it persists, report to the user with evidence
If there are console errors
- Use
playwright_browser_console_messagesto get errors - Include in results report
Important Notes
- ALWAYS use headless mode (--headed=false) to avoid interfering with the user
- ALWAYS look for CREDENTIALS.md before asking for credentials
- ALWAYS ask for confirmation before running tests
- NEVER create, modify, or delete test users
- NEVER use IPv6, always 127.0.0.1