full-workflow
npx skills add https://github.com/cristian-robert/autonomous-automation-tester --skill full-workflow
Agent 安装分布
Skill 文档
Full Testing Workflow
Complete autonomous workflow: Check Existing â Discover â Design â Qase â Automate â Run
Trigger Phrases
- “Test [URL]”
- “Create a test suite for [URL]”
- “Help me automate testing for [URL]”
- “I need tests for [website]”
Prerequisites Check
Before starting, verify:
1. QASE_API_TOKEN is set
2. QASE_PROJECT_CODE is set
3. MCP config has Playwright server (mcp-config.json)
If missing, ask user to configure.
Phase 0: CHECK EXISTING (MANDATORY)
Goal: Check Qase for existing test cases before creating new ones
Use: qase-client skill
# Search for existing cases by feature keywords
python scripts/qase_client.py search-cases PROJ "login"
python scripts/qase_client.py search-cases PROJ "navigation"
python scripts/qase_client.py search-cases PROJ "homepage"
# List existing suites
python scripts/qase_client.py suites PROJ
# Get details of existing cases if needed
python scripts/qase_client.py get-case PROJ <case_id>
Output:
- List of existing test cases and their coverage
- Gaps that need new test cases
- Existing Qase case IDs to reuse for automation
Decision:
- If comprehensive coverage exists â Skip to Phase 4 (Automate)
- If partial coverage exists â Note existing IDs, create only missing cases
- If no coverage exists â Continue with full workflow
Phase 1: DISCOVER
Goal: Map the website structure
Use: site-discovery + mcp-client skills (Playwright server)
â ï¸ CRITICAL: Playwright Session Behavior
Each MCP call = new browser session. Browser CLOSES after each call. Use
browser_run_codefor any multi-step exploration. If you need to explore multiple pages, each exploration is a FRESH session.
1. Use browser_run_code to:
- Navigate to homepage
- Accept cookies
- Extract all links + snapshot
2. For each subpage, use browser_run_code AGAIN (session closed!):
- Navigate to URL
- Accept cookies AGAIN
- Capture snapshot
3. Classify each page type
4. Document auth requirements
Example for homepage:
python .claude/skills/mcp-client/scripts/mcp_client.py call playwright browser_run_code '{
"code": "
await page.goto(\"https://example.com\");
// Handle cookies (every session needs this!)
const acceptBtn = page.getByRole(\"button\", { name: /accept/i });
if (await acceptBtn.isVisible({ timeout: 3000 }).catch(() => false)) {
await acceptBtn.click();
await page.waitForTimeout(500);
}
// Extract navigation
const navLinks = await page.locator(\"nav a\").evaluateAll(els =>
els.map(e => ({ text: e.textContent?.trim(), href: e.href }))
);
const snapshot = await page.accessibility.snapshot();
return JSON.stringify({ navLinks, snapshot }, null, 2);
"
}'
Output: Site map with classified pages
Phase 1.5: DISCOVER BEHAVIORAL DATA (For Negative Tests)
MANDATORY before designing negative tests! You must discover actual error messages, validation behavior, and UI states.
Goal: Capture real error messages, validation text, and behavioral data
Use: mcp-client skill with browser_run_code
What to discover:
| Test Type | Trigger | Capture |
|---|---|---|
| Login failure | Submit wrong credentials | Error message text, selector |
| Empty field | Submit empty form | Validation message, type (HTML5 or custom) |
| Invalid email | Submit malformed email | Validation message |
| Success redirect | Complete valid action | Redirect URL pattern |
Example – Discover login error:
python .claude/skills/mcp-client/scripts/mcp_client.py call playwright browser_run_code '{
"code": "
await page.goto(\"https://example.com/login\");
// Cookies
const acceptBtn = page.getByRole(\"button\", { name: /accept/i });
if (await acceptBtn.isVisible({ timeout: 3000 }).catch(() => false)) {
await acceptBtn.click();
}
// Trigger error
await page.fill(\"input[type=email]\", \"fake@test.com\");
await page.fill(\"input[type=password]\", \"wrongpass\");
await page.click(\"button[type=submit]\");
await page.waitForTimeout(3000);
// Capture error elements
const errors = await page.locator(\"[class*=error], [role=alert]\").evaluateAll(els =>
els.map(e => ({ text: e.textContent?.trim(), role: e.getAttribute(\"role\") }))
);
return JSON.stringify({ errors }, null, 2);
"
}'
Output: Behavioral data to use in test assertions
{
"errors": [{ "text": "Email sau parolÄ incorectÄ", "role": "alert" }]
}
Use discovered values in tests:
// DON'T: await expect(page.locator('.error')).toContainText('Invalid credentials');
// DO: Use the ACTUAL discovered text
await expect(page.getByRole('alert')).toContainText('Email sau parolÄ incorectÄ');
Phase 2: DESIGN
Goal: Create test case specifications
Use: automation-tester skill
1. For each page type, apply test patterns
2. Assign priorities (P0/P1/P2)
3. Generate test case specs
4. Group into logical suites
Output: Test case list organized by suite
Phase 3: SYNC TO QASE
Goal: Push test suites and cases to Qase.io
Use: qase-client skill
# Create suites
python qase_client.py create-suite PROJ '{"title": "Authentication"}'
python qase_client.py create-suite PROJ '{"title": "Navigation"}'
python qase_client.py create-suite PROJ '{"title": "Core Features"}'
# Create cases in each suite
python qase_client.py create-case PROJ '{"title": "Valid login redirects", "suite_id": 1, "severity": 1}'
# ... repeat for each case
Output: Qase case IDs mapped to test specs
Phase 4: AUTOMATE
Goal: Generate Playwright test code
Use: test-generation skill
1. Create page objects for each tested page
2. Generate test specs for each suite
3. Link tests to Qase case IDs
4. Create playwright.config.ts if missing
Output:
pages/
âââ login.page.ts
âââ products.page.ts
tests/
âââ auth.spec.ts
âââ navigation.spec.ts
âââ products.spec.ts
playwright.config.ts
Phase 5: RUN & REPORT
Goal: Execute tests and report to Qase
# Install dependencies
npm install @playwright/test
npx playwright install chromium
# Run tests
npx playwright test
# Report results to Qase
python qase_client.py create-run PROJ '{"title": "Automated Run"}'
python qase_client.py report-result PROJ 1 '{"case_id": 1, "status": "passed"}'
python qase_client.py complete-run PROJ 1
Workflow Summary
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â USER REQUEST â
â "Test myplatform.com" â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 0: CHECK EXISTING (MANDATORY) â
â ⢠Search Qase for existing test cases â
â ⢠Identify existing coverage â
â ⢠Note gaps and reusable case IDs â
â Output: Existing coverage + gaps list â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âââââââââââ´ââââââââââ
â â
(if full coverage) (if gaps exist)
â â
â¼ â¼
Skip to Phase 4 Continue workflow
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 1: DISCOVER â
â ⢠Navigate site via mcp-client (Playwright) â
â ⢠Map pages and classify types â
â ⢠Identify auth requirements â
â Output: Site map â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 1.5: DISCOVER BEHAVIORAL DATA (MANDATORY for neg) â
â ⢠Trigger error states (bad login, validation, etc.) â
â ⢠Capture ACTUAL error messages and selectors â
â ⢠Document success/failure behaviors â
â Output: Real text/selectors for test assertions â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 2: DESIGN â
â ⢠Apply test patterns by page type â
â ⢠Assign P0/P1/P2 priorities â
â ⢠Group into suites (skip existing cases) â
â ⢠Use discovered text for negative test assertions â
â Output: Test case specifications (gaps only) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 3: SYNC TO QASE â
â ⢠Create suites via API (only if not exists) â
â ⢠Create cases with steps (gaps only) â
â ⢠Record Qase IDs (existing + new) â
â Output: Complete case ID mapping â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 4: AUTOMATE â
â ⢠Generate page objects â
â ⢠Generate test specs â
â ⢠Link to Qase IDs (existing + new) â
â Output: Playwright test files â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PHASE 5: RUN & REPORT â
â ⢠Execute tests â
â ⢠Create test run in Qase â
â ⢠Report results â
â Output: Test results in Qase â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Example Conversation
User: Test myplatform.com, we use Qase.io
Claude: I'll help you test myplatform.com with Qase integration.
**Setup Check**
â QASE_API_TOKEN detected
â QASE_PROJECT_CODE: MYPROJ
â Playwright MCP connected
**Phase 0: Checking Existing Cases**
Searching Qase for existing test cases...
Found existing coverage:
- Suite "Authentication" (ID: 1) - 3 cases
- Login with valid credentials (ID: 1)
- Login with invalid password (ID: 2)
- Logout successfully (ID: 3)
- Suite "Navigation" (ID: 2) - 2 cases
- Main menu links work (ID: 4)
- Footer links work (ID: 5)
Gaps identified:
- No registration tests
- No product listing tests
- No cart/checkout tests
**Phase 1: Discovery**
Exploring myplatform.com for gaps...
Found 8 key pages:
- / (Homepage)
- /login (Auth - COVERED)
- /register (Auth - GAP)
- /products (Listing - GAP)
- /products/:id (Detail - GAP)
- /cart (Transaction - GAP)
- /checkout (Transaction - GAP)
- /account (Dashboard - requires auth)
**Phase 2: Design**
Designed 12 NEW test cases (reusing 5 existing):
- Authentication: +2 new (registration tests)
- Products: +6 new
- Cart: +4 new
**Phase 3: Creating in Qase (gaps only)**
â Using existing suite "Authentication" (ID: 1)
â Created suite "Products" (ID: 3)
â Created suite "Cart" (ID: 4)
â Created 12 new test cases (cases 6-17)
Total coverage: 17 test cases (5 existing + 12 new)
**Phase 4: Generating Tests**
Created files:
- pages/login.page.ts
- pages/products.page.ts
- pages/cart.page.ts
- tests/auth.spec.ts (includes existing case IDs 1-5)
- tests/products.spec.ts (case IDs 6-11)
- tests/cart.spec.ts (case IDs 12-17)
**Phase 5: Ready to Run**
```bash
npm install
npx playwright test
Results will sync to Qase automatically.
## Decision Points
| Situation | Action |
|-----------|--------|
| No auth credentials | Test public pages only |
| Payment required | Test until payment step |
| Auth wall on first page | Ask for credentials |
| >50 pages found | Focus on main nav |
| Site errors | Document and continue |
## References
See the references folder for detailed documentation:
- **[workflow-checklist.md](references/workflow-checklist.md)** - Step-by-step checklist for each phase
- **[decision-tree.md](references/decision-tree.md)** - Visual decision trees for common scenarios
- **[phase-outputs.md](references/phase-outputs.md)** - Expected output format for each phase