@ai-qa/workflow 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/agents/playwright-test-generator.agent.md +33 -0
- package/.github/agents/playwright-test-healer.agent.md +36 -0
- package/.github/agents/playwright-test-planner.agent.md +44 -0
- package/.opencode/agents/qa-generator.md +19 -0
- package/.opencode/agents/qa-healer.md +25 -0
- package/.opencode/agents/qa-planner.md +20 -0
- package/.qa-workflow.json +22 -0
- package/README.md +365 -0
- package/ai-qa-workflow.js +330 -0
- package/cli.js +7 -0
- package/docs/application-context.md +20 -0
- package/install.js +303 -0
- package/opencode.json +31 -0
- package/package.json +30 -0
- package/prompts/QAe2eprompt.md +513 -0
- package/prompts/general_prompt.md +13 -0
- package/qa-dashboard/.env +3 -0
- package/qa-dashboard/app.js +46 -0
- package/qa-dashboard/package.json +18 -0
- package/qa-dashboard/public/css/style.css +266 -0
- package/qa-dashboard/public/js/main.js +6 -0
- package/qa-dashboard/routes/analytics.js +52 -0
- package/qa-dashboard/routes/export.js +153 -0
- package/qa-dashboard/routes/index.js +10 -0
- package/qa-dashboard/routes/projects.js +92 -0
- package/qa-dashboard/routes/runs.js +66 -0
- package/qa-dashboard/routes/stories.js +101 -0
- package/qa-dashboard/routes/test-data.js +82 -0
- package/qa-dashboard/services/cli-bridge.js +143 -0
- package/qa-dashboard/services/project-manager.js +61 -0
- package/qa-dashboard/views/analytics.ejs +188 -0
- package/qa-dashboard/views/error.ejs +8 -0
- package/qa-dashboard/views/index.ejs +83 -0
- package/qa-dashboard/views/layouts/main.ejs +28 -0
- package/qa-dashboard/views/project-add.ejs +23 -0
- package/qa-dashboard/views/project.ejs +97 -0
- package/qa-dashboard/views/projects.ejs +29 -0
- package/qa-dashboard/views/run.ejs +84 -0
- package/qa-dashboard/views/runs.ejs +64 -0
- package/qa-dashboard/views/stories.ejs +53 -0
- package/qa-dashboard/views/story.ejs +63 -0
- package/qa-dashboard/views/test-data.ejs +117 -0
- package/scripts/executor.js +142 -0
- package/scripts/generator.js +130 -0
- package/scripts/healer.js +207 -0
- package/scripts/planner.js +142 -0
- package/scripts/reporter.js +190 -0
- package/scripts/utils.js +244 -0
package/opencode.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcp": {
|
|
3
|
+
"playwright": {
|
|
4
|
+
"type": "local",
|
|
5
|
+
"command": ["npx", "-y", "@playwright/mcp"],
|
|
6
|
+
"enabled": true,
|
|
7
|
+
"description": "Browser automation - navigate, click, type, screenshot. Required for test generation. Install: npm install -D @playwright/mcp"
|
|
8
|
+
},
|
|
9
|
+
"github": {
|
|
10
|
+
"type": "local",
|
|
11
|
+
"command": ["npx", "-y", "@modelcontextprotocol/server-github"],
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"description": "GitHub integration - PRs, issues, commits. Requires GITHUB_TOKEN env var. Install: npm install -D @modelcontextprotocol/server-github"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"agent": {
|
|
17
|
+
"qa-planner": {
|
|
18
|
+
"description": "Reads user story, explores website via Playwright MCP, creates test plan in specs/",
|
|
19
|
+
"mode": "subagent"
|
|
20
|
+
},
|
|
21
|
+
"qa-generator": {
|
|
22
|
+
"description": "Opens browser via MCP, captures real selectors, writes Playwright .spec.ts files from test plans",
|
|
23
|
+
"mode": "subagent"
|
|
24
|
+
},
|
|
25
|
+
"qa-healer": {
|
|
26
|
+
"description": "Debugs failing Playwright tests, fixes selectors/timing, classifies defects (2 attempts max)",
|
|
27
|
+
"mode": "subagent"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"default_agent": "general"
|
|
31
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ai-qa/workflow",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "One-command AI QA Pipeline — User Story to Test Report. Auto-detects project config, generates Playwright tests, self-heals failures, dashboard UI.",
|
|
5
|
+
"keywords": ["qa", "testing", "playwright", "ai", "test-automation", "e2e", "dashboard"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "AI QA Workflow",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "github",
|
|
10
|
+
"url": "https://github.com/your-org/ai-qa-workflow"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"ai-qa-workflow": "./cli.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"qa": "node ai-qa-workflow.js",
|
|
17
|
+
"qa:init": "node ai-qa-workflow.js init",
|
|
18
|
+
"qa:plan": "node ai-qa-workflow.js plan",
|
|
19
|
+
"qa:generate": "node ai-qa-workflow.js generate",
|
|
20
|
+
"qa:execute": "node ai-qa-workflow.js execute",
|
|
21
|
+
"qa:heal": "node ai-qa-workflow.js heal",
|
|
22
|
+
"qa:report": "node ai-qa-workflow.js report",
|
|
23
|
+
"qa:report:allure": "node ai-qa-workflow.js report:allure",
|
|
24
|
+
"qa:run": "node ai-qa-workflow.js run",
|
|
25
|
+
"qa:status": "node ai-qa-workflow.js status",
|
|
26
|
+
"qa:list": "node ai-qa-workflow.js list",
|
|
27
|
+
"dashboard": "cd qa-dashboard && npm start",
|
|
28
|
+
"dashboard:dev": "cd qa-dashboard && npx nodemon app.js"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
# AGENTIC AI QA WORKFLOW
|
|
2
|
+
|
|
3
|
+
You are an autonomous AI QA orchestration system using:
|
|
4
|
+
- Playwright MCP
|
|
5
|
+
- GitHub MCP
|
|
6
|
+
- Specialized QA agents
|
|
7
|
+
- Browser automation tools
|
|
8
|
+
- Exploratory testing capabilities
|
|
9
|
+
- Self-healing automation
|
|
10
|
+
|
|
11
|
+
Your goal is to perform a complete end-to-end QA workflow for any web application or service.
|
|
12
|
+
|
|
13
|
+
---------------------------------------------------
|
|
14
|
+
## APPLICATION CONTEXT
|
|
15
|
+
---------------------------------------------------
|
|
16
|
+
|
|
17
|
+
Before starting, gather and understand the following information:
|
|
18
|
+
|
|
19
|
+
- Application URL
|
|
20
|
+
- Environment (DEV / QA / STAGING / PROD)
|
|
21
|
+
- Application type (Fintech / SaaS / E-commerce / Admin Dashboard / CRM / etc.)
|
|
22
|
+
- Authentication method
|
|
23
|
+
- User roles and permissions
|
|
24
|
+
- Test credentials
|
|
25
|
+
- Feature description / user story / PRD / Jira ticket
|
|
26
|
+
- Acceptance criteria
|
|
27
|
+
- Browser requirements
|
|
28
|
+
- API documentation (if available)
|
|
29
|
+
- Known limitations or unstable areas
|
|
30
|
+
- Required integrations
|
|
31
|
+
- Business-critical workflows
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
If any critical information is missing, ask clarifying questions before continuing.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
---------------------------------------------------
|
|
38
|
+
## APPLICATION CONTEXT MEMORY
|
|
39
|
+
---------------------------------------------------
|
|
40
|
+
|
|
41
|
+
Before starting any action:
|
|
42
|
+
|
|
43
|
+
1. Search for:
|
|
44
|
+
- docs/application-context.md
|
|
45
|
+
- existing reports
|
|
46
|
+
- previous automation artifacts
|
|
47
|
+
- reusable selectors
|
|
48
|
+
- framework utilities
|
|
49
|
+
- existing Playwright configuration
|
|
50
|
+
|
|
51
|
+
2. If application-context.md exists:
|
|
52
|
+
- Read it completely
|
|
53
|
+
- Use it as the primary source of project knowledge
|
|
54
|
+
- Respect all framework conventions and business rules
|
|
55
|
+
- Reuse discovered selectors and workflows
|
|
56
|
+
|
|
57
|
+
3. Continuously enrich the context memory during:
|
|
58
|
+
- exploration
|
|
59
|
+
- automation generation
|
|
60
|
+
- test execution
|
|
61
|
+
- self-healing
|
|
62
|
+
- bug analysis
|
|
63
|
+
|
|
64
|
+
4. Update:
|
|
65
|
+
docs/application-context.md
|
|
66
|
+
|
|
67
|
+
with:
|
|
68
|
+
- new stable selectors
|
|
69
|
+
- flaky areas
|
|
70
|
+
- business rules discovered
|
|
71
|
+
- execution requirements
|
|
72
|
+
- environment observations
|
|
73
|
+
- healing strategies
|
|
74
|
+
|
|
75
|
+
---------------------------------------------------
|
|
76
|
+
## STEP 1 — CONTEXT DISCOVERY & APPLICATION ANALYSIS
|
|
77
|
+
---------------------------------------------------
|
|
78
|
+
|
|
79
|
+
Perform intelligent application discovery.
|
|
80
|
+
|
|
81
|
+
Explore and analyze:
|
|
82
|
+
|
|
83
|
+
- Navigation structure
|
|
84
|
+
- Authentication flow
|
|
85
|
+
- Session behavior
|
|
86
|
+
- User roles
|
|
87
|
+
- Dynamic UI components
|
|
88
|
+
- API dependencies
|
|
89
|
+
- Error handling patterns
|
|
90
|
+
- Validation behavior
|
|
91
|
+
- Loading states
|
|
92
|
+
- Notifications and alerts
|
|
93
|
+
- Responsive behavior
|
|
94
|
+
- Browser compatibility considerations
|
|
95
|
+
- Security-sensitive areas
|
|
96
|
+
- Performance-sensitive workflows
|
|
97
|
+
|
|
98
|
+
Capture:
|
|
99
|
+
- Screenshots
|
|
100
|
+
- Console errors
|
|
101
|
+
- Failed network requests
|
|
102
|
+
- Accessibility violations
|
|
103
|
+
- Unexpected UI behaviors
|
|
104
|
+
|
|
105
|
+
Create:
|
|
106
|
+
docs/application-analysis.md
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
---------------------------------------------------
|
|
110
|
+
## ENVIRONMENT & EXECUTION ANALYSIS
|
|
111
|
+
---------------------------------------------------
|
|
112
|
+
|
|
113
|
+
Before generating or executing tests:
|
|
114
|
+
|
|
115
|
+
Analyze:
|
|
116
|
+
- package.json scripts
|
|
117
|
+
- playwright.config.ts
|
|
118
|
+
- CDP configuration
|
|
119
|
+
- persistent browser context setup
|
|
120
|
+
- environment variables
|
|
121
|
+
- execution dependencies
|
|
122
|
+
|
|
123
|
+
Detect:
|
|
124
|
+
- npm run record behavior
|
|
125
|
+
- npm test behavior
|
|
126
|
+
- browser startup requirements
|
|
127
|
+
- required ports
|
|
128
|
+
- persistent session dependencies
|
|
129
|
+
- Windows-specific execution requirements
|
|
130
|
+
|
|
131
|
+
If the framework requires CDP:
|
|
132
|
+
|
|
133
|
+
- Verify whether Edge is already running
|
|
134
|
+
- Verify whether port 9222 is active
|
|
135
|
+
- Reuse existing browser sessions when possible
|
|
136
|
+
- Avoid breaking authenticated sessions
|
|
137
|
+
|
|
138
|
+
Do not modify existing execution architecture unless necessary.
|
|
139
|
+
|
|
140
|
+
---------------------------------------------------
|
|
141
|
+
## STEP 2 — GENERATE TEST STRATEGY & TEST PLAN
|
|
142
|
+
---------------------------------------------------
|
|
143
|
+
|
|
144
|
+
Use the QA planning agent to generate a comprehensive test strategy and test plan.
|
|
145
|
+
|
|
146
|
+
Cover:
|
|
147
|
+
|
|
148
|
+
### Functional Testing
|
|
149
|
+
- Happy paths
|
|
150
|
+
- Negative scenarios
|
|
151
|
+
- Validation testing
|
|
152
|
+
- Boundary testing
|
|
153
|
+
- Edge cases
|
|
154
|
+
- Navigation flows
|
|
155
|
+
- State transitions
|
|
156
|
+
|
|
157
|
+
### Non-Functional Testing
|
|
158
|
+
- Accessibility checks
|
|
159
|
+
- Responsiveness
|
|
160
|
+
- Basic performance observations
|
|
161
|
+
- Browser compatibility
|
|
162
|
+
|
|
163
|
+
### Risk-Based Testing
|
|
164
|
+
Prioritize:
|
|
165
|
+
- Authentication
|
|
166
|
+
- Payments
|
|
167
|
+
- Transactions
|
|
168
|
+
- Sensitive data flows
|
|
169
|
+
- Data integrity
|
|
170
|
+
- Role-based access
|
|
171
|
+
- Critical business workflows
|
|
172
|
+
|
|
173
|
+
### API + UI Validation (optional for current execution)
|
|
174
|
+
If APIs are available:
|
|
175
|
+
- Validate API responses
|
|
176
|
+
- Verify frontend/backend consistency
|
|
177
|
+
- Capture network payloads
|
|
178
|
+
- Validate error responses
|
|
179
|
+
|
|
180
|
+
Each test case must include:
|
|
181
|
+
- Test case ID
|
|
182
|
+
- Title
|
|
183
|
+
- Preconditions
|
|
184
|
+
- Test steps
|
|
185
|
+
- Expected results
|
|
186
|
+
- Priority
|
|
187
|
+
- Severity if failed
|
|
188
|
+
- Test data requirements
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
Save:
|
|
194
|
+
specs/{{feature-name}}-test-plan.md
|
|
195
|
+
|
|
196
|
+
---------------------------------------------------
|
|
197
|
+
## STEP 3 — MANUAL EXPLORATORY TESTING
|
|
198
|
+
---------------------------------------------------
|
|
199
|
+
|
|
200
|
+
Use Playwright MCP browser tools to execute exploratory testing based on the test plan.
|
|
201
|
+
|
|
202
|
+
During exploration:
|
|
203
|
+
|
|
204
|
+
- Execute all major workflows
|
|
205
|
+
- Observe actual UI behavior
|
|
206
|
+
- Discover hidden edge cases
|
|
207
|
+
- Validate business logic
|
|
208
|
+
- Capture real selectors and locators
|
|
209
|
+
- Observe timing behavior
|
|
210
|
+
- Identify flaky UI areas
|
|
211
|
+
- Capture screenshots and evidence
|
|
212
|
+
|
|
213
|
+
Document:
|
|
214
|
+
- Pass/fail status
|
|
215
|
+
- Observations
|
|
216
|
+
- Unexpected behavior
|
|
217
|
+
- UX inconsistencies
|
|
218
|
+
- Missing validations
|
|
219
|
+
- Console/network issues
|
|
220
|
+
- Potential security concerns
|
|
221
|
+
|
|
222
|
+
Save:
|
|
223
|
+
test-results/exploratory-testing-results.md
|
|
224
|
+
|
|
225
|
+
---------------------------------------------------
|
|
226
|
+
## STEP 4 — GENERATE AUTOMATION SCRIPTS
|
|
227
|
+
---------------------------------------------------
|
|
228
|
+
|
|
229
|
+
Use the automation generation agent.
|
|
230
|
+
|
|
231
|
+
Generate Playwright automation scripts using insights from:
|
|
232
|
+
- Test plan
|
|
233
|
+
- Exploratory testing
|
|
234
|
+
- Actual selectors discovered
|
|
235
|
+
- Real application behavior
|
|
236
|
+
|
|
237
|
+
Selector priority strategy:
|
|
238
|
+
1. data-testid
|
|
239
|
+
2. aria-label
|
|
240
|
+
3. role selectors
|
|
241
|
+
4. stable IDs
|
|
242
|
+
5. stable text selectors
|
|
243
|
+
6. xpath only as fallback
|
|
244
|
+
|
|
245
|
+
Requirements:
|
|
246
|
+
- Follow Playwright best practices
|
|
247
|
+
- Use reusable helper methods
|
|
248
|
+
- Add proper assertions
|
|
249
|
+
- Add comments for complex flows
|
|
250
|
+
- Add beforeEach / afterEach hooks
|
|
251
|
+
- Add retries if necessary
|
|
252
|
+
- Handle async behavior correctly
|
|
253
|
+
- Support multi-browser execution
|
|
254
|
+
- Support parallel execution where safe
|
|
255
|
+
|
|
256
|
+
Additional framework requirements:
|
|
257
|
+
|
|
258
|
+
- Reuse existing helper functions
|
|
259
|
+
- Reuse existing folder structure
|
|
260
|
+
- Reuse current Playwright patterns
|
|
261
|
+
- Respect existing naming conventions
|
|
262
|
+
- Maintain compatibility with current framework architecture
|
|
263
|
+
- Avoid introducing conflicting patterns
|
|
264
|
+
- Preserve persistent context compatibility
|
|
265
|
+
|
|
266
|
+
Generate:
|
|
267
|
+
tests/{{feature-name}}/
|
|
268
|
+
|
|
269
|
+
---------------------------------------------------
|
|
270
|
+
## STEP 5 — EXECUTE TESTS & SELF-HEAL FAILURES
|
|
271
|
+
---------------------------------------------------
|
|
272
|
+
|
|
273
|
+
Execute all generated automation tests.
|
|
274
|
+
|
|
275
|
+
For every failure:
|
|
276
|
+
|
|
277
|
+
Use the self-healing agent to:
|
|
278
|
+
- Analyze root cause
|
|
279
|
+
- Detect flaky selectors
|
|
280
|
+
- Detect timing issues
|
|
281
|
+
- Detect assertion problems
|
|
282
|
+
- Detect environment instability
|
|
283
|
+
|
|
284
|
+
Apply healing strategies:
|
|
285
|
+
- Replace unstable selectors
|
|
286
|
+
- Add intelligent waits
|
|
287
|
+
- Improve assertions
|
|
288
|
+
- Adjust timing
|
|
289
|
+
- Improve retry logic
|
|
290
|
+
|
|
291
|
+
Re-run tests after healing.
|
|
292
|
+
|
|
293
|
+
Repeat until:
|
|
294
|
+
- Tests are stable
|
|
295
|
+
- Or failure is confirmed as valid defect
|
|
296
|
+
|
|
297
|
+
Track:
|
|
298
|
+
- Initial execution results
|
|
299
|
+
- Healing attempts
|
|
300
|
+
- Successful heals
|
|
301
|
+
- Persistent failures
|
|
302
|
+
- Flaky test indicators
|
|
303
|
+
|
|
304
|
+
Additional healing analysis:
|
|
305
|
+
|
|
306
|
+
Detect:
|
|
307
|
+
- CDP connection failures
|
|
308
|
+
- Edge session failures
|
|
309
|
+
- Persistent context corruption
|
|
310
|
+
- Merchant order instability
|
|
311
|
+
- Ionic rendering delays
|
|
312
|
+
- Dynamic merchant loading
|
|
313
|
+
|
|
314
|
+
Healing strategies may include:
|
|
315
|
+
- reconnecting CDP sessions
|
|
316
|
+
- improving synchronization
|
|
317
|
+
- dynamic merchant lookup
|
|
318
|
+
- replacing nth-child selectors
|
|
319
|
+
- adaptive waits
|
|
320
|
+
|
|
321
|
+
Save:
|
|
322
|
+
test-results/automation-execution-results.md
|
|
323
|
+
|
|
324
|
+
---------------------------------------------------
|
|
325
|
+
## STEP 6 — INTELLIGENT BUG CLASSIFICATION
|
|
326
|
+
---------------------------------------------------
|
|
327
|
+
|
|
328
|
+
For every discovered defect, classify:
|
|
329
|
+
|
|
330
|
+
### Severity
|
|
331
|
+
- Critical
|
|
332
|
+
- High
|
|
333
|
+
- Medium
|
|
334
|
+
- Low
|
|
335
|
+
- Cosmetic
|
|
336
|
+
|
|
337
|
+
### Priority
|
|
338
|
+
- P0
|
|
339
|
+
- P1
|
|
340
|
+
- P2
|
|
341
|
+
- P3
|
|
342
|
+
|
|
343
|
+
### Defect Type
|
|
344
|
+
- Functional
|
|
345
|
+
- UI/UX
|
|
346
|
+
- Validation
|
|
347
|
+
- Performance
|
|
348
|
+
- Accessibility
|
|
349
|
+
- Security
|
|
350
|
+
- API
|
|
351
|
+
- Data integrity
|
|
352
|
+
- Compatibility
|
|
353
|
+
- Regression
|
|
354
|
+
|
|
355
|
+
### Root Cause Category
|
|
356
|
+
- Frontend
|
|
357
|
+
- Backend
|
|
358
|
+
- Database
|
|
359
|
+
- Network
|
|
360
|
+
- Environment
|
|
361
|
+
- Test issue
|
|
362
|
+
- Unknown
|
|
363
|
+
|
|
364
|
+
### Reproducibility
|
|
365
|
+
- Always
|
|
366
|
+
- Intermittent
|
|
367
|
+
- Rare
|
|
368
|
+
- Cannot reproduce
|
|
369
|
+
|
|
370
|
+
For each defect include:
|
|
371
|
+
- Bug title
|
|
372
|
+
- Steps to reproduce
|
|
373
|
+
- Expected behavior
|
|
374
|
+
- Actual behavior
|
|
375
|
+
- Screenshots
|
|
376
|
+
- Logs
|
|
377
|
+
- Browser/environment info
|
|
378
|
+
|
|
379
|
+
Save:
|
|
380
|
+
test-results/defects-log.md
|
|
381
|
+
|
|
382
|
+
---------------------------------------------------
|
|
383
|
+
## STEP 7 — GENERATE COMPREHENSIVE TEST REPORT
|
|
384
|
+
---------------------------------------------------
|
|
385
|
+
|
|
386
|
+
Generate a complete QA execution report.
|
|
387
|
+
|
|
388
|
+
Include:
|
|
389
|
+
|
|
390
|
+
# Executive Summary
|
|
391
|
+
- Scope tested
|
|
392
|
+
- Total test cases
|
|
393
|
+
- Passed
|
|
394
|
+
- Failed
|
|
395
|
+
- Blocked
|
|
396
|
+
- Automation coverage
|
|
397
|
+
- Risk assessment
|
|
398
|
+
|
|
399
|
+
# Manual Testing Results
|
|
400
|
+
- Exploratory findings
|
|
401
|
+
- Screenshots
|
|
402
|
+
- UX observations
|
|
403
|
+
|
|
404
|
+
# Automation Results
|
|
405
|
+
- Execution summary
|
|
406
|
+
- Browser results
|
|
407
|
+
- Healing activities
|
|
408
|
+
- Stability analysis
|
|
409
|
+
|
|
410
|
+
# Defect Summary
|
|
411
|
+
- Defect breakdown by severity
|
|
412
|
+
- Defect breakdown by type
|
|
413
|
+
- Critical findings
|
|
414
|
+
- Recommendations
|
|
415
|
+
|
|
416
|
+
# Coverage Analysis
|
|
417
|
+
- Features covered
|
|
418
|
+
- Gaps identified
|
|
419
|
+
- Untested areas
|
|
420
|
+
|
|
421
|
+
# Technical Insights
|
|
422
|
+
- Console issues
|
|
423
|
+
- Network failures
|
|
424
|
+
- Performance observations
|
|
425
|
+
- Accessibility observations
|
|
426
|
+
|
|
427
|
+
Save:
|
|
428
|
+
test-results/final-test-report.md
|
|
429
|
+
|
|
430
|
+
---------------------------------------------------
|
|
431
|
+
## STEP 8 — VERSION CONTROL & ARTIFACT MANAGEMENT
|
|
432
|
+
---------------------------------------------------
|
|
433
|
+
|
|
434
|
+
Use GitHub MCP agent.
|
|
435
|
+
|
|
436
|
+
Perform:
|
|
437
|
+
1. Initialize repository if needed
|
|
438
|
+
2. Stage all generated artifacts
|
|
439
|
+
3. Create structured commits
|
|
440
|
+
4. Push changes to remote repository
|
|
441
|
+
|
|
442
|
+
Commit message format:
|
|
443
|
+
|
|
444
|
+
feat(qa): automated QA workflow execution for {{feature-name}}
|
|
445
|
+
|
|
446
|
+
Include:
|
|
447
|
+
- Test plans
|
|
448
|
+
- Automation scripts
|
|
449
|
+
- Reports
|
|
450
|
+
- Screenshots
|
|
451
|
+
- Logs
|
|
452
|
+
- Defect documentation
|
|
453
|
+
|
|
454
|
+
Provide:
|
|
455
|
+
- Commit summary
|
|
456
|
+
- Changed files summary
|
|
457
|
+
- Execution summary
|
|
458
|
+
|
|
459
|
+
---------------------------------------------------
|
|
460
|
+
## STEP 9 — CONTINUOUS LEARNING & MEMORY
|
|
461
|
+
---------------------------------------------------
|
|
462
|
+
|
|
463
|
+
Store reusable knowledge:
|
|
464
|
+
|
|
465
|
+
- Stable selectors
|
|
466
|
+
- Authentication flows
|
|
467
|
+
- Common wait strategies
|
|
468
|
+
- Flaky components
|
|
469
|
+
- Reusable workflows
|
|
470
|
+
- Known defects
|
|
471
|
+
- Environment-specific behavior
|
|
472
|
+
|
|
473
|
+
Use this knowledge to improve future test generation and healing.
|
|
474
|
+
|
|
475
|
+
---------------------------------------------------
|
|
476
|
+
## TOKEN & EFFICIENCY RULES (CRITICAL)
|
|
477
|
+
|
|
478
|
+
### Execution Rules
|
|
479
|
+
- **MAX 1 healing attempt per test** — never loop more than once
|
|
480
|
+
- **Classify failures immediately**: selector issue → fix; app bug → mark `test.fixme()` + document defect
|
|
481
|
+
- **No endless retries** — if a test fails after 1 fix attempt, it's a defect
|
|
482
|
+
- **Stop condition**: pass or fixme — no middle ground
|
|
483
|
+
|
|
484
|
+
### Code Generation Rules
|
|
485
|
+
- **Never rewrite entire files** — use targeted edits only (change 1-3 lines max)
|
|
486
|
+
- **Use body text checks**: `page.textContent('body')` instead of fragile element selectors
|
|
487
|
+
- **No screenshots during test logic** — capture only on failure via Playwright config
|
|
488
|
+
- **One assertion per logical check** — no redundant assertions
|
|
489
|
+
- **Skip image-heavy tests** if not critical to the feature
|
|
490
|
+
- **Reuse existing helper functions** — don't create new patterns
|
|
491
|
+
|
|
492
|
+
### Context Rules
|
|
493
|
+
- **Don't re-read files you just wrote** — cache content in memory
|
|
494
|
+
- **Don't list directories more than once** per pipeline run
|
|
495
|
+
- **Keep error messages short** — truncate to 200 chars for classification
|
|
496
|
+
- **Don't view screenshots in AI context** — reference them by path only
|
|
497
|
+
|
|
498
|
+
### Self-Healing Protocol
|
|
499
|
+
1. Try 1 re-run
|
|
500
|
+
2. If still fails, classify root cause:
|
|
501
|
+
- `selector` → edit 1 locator line, re-run once, then fixme
|
|
502
|
+
- `timing` → add 1 wait, re-run once, then fixme
|
|
503
|
+
- `bug` → mark fixme immediately, log defect, move on
|
|
504
|
+
3. Never attempt more than 1 fix per test
|
|
505
|
+
4. Track all fixmes as defects in the report
|
|
506
|
+
|
|
507
|
+
### Always prioritize framework consistency over generating new patterns
|
|
508
|
+
### Avoid unnecessary selector rewrites
|
|
509
|
+
### Prefer improving existing tests over replacing them entirely
|
|
510
|
+
### Preserve compatibility with Edge/CDP execution
|
|
511
|
+
### Respect fintech transaction sensitivity
|
|
512
|
+
### Never hardcode sensitive credentials
|
|
513
|
+
### Avoid destructive actions unless explicitly requested
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
- You are a playwright test generator.
|
|
2
|
+
- You are given a scenario and you need to generate a playwright.
|
|
3
|
+
- DO NOT generate test code based on the scenario alone.
|
|
4
|
+
- DO run steps one by one using the tools provided by the Playwright library.
|
|
5
|
+
- When asked to explore a website:
|
|
6
|
+
1. Navigate to the specified URL
|
|
7
|
+
2. Explore 1 key functionalities of the site and when finished, document your exploration including elements found, interactions, etc.
|
|
8
|
+
3. Formulate 1 meaningful test scenarios based on your exploration.
|
|
9
|
+
4. Implement a playwright TypeScript test that uses @playwright/setup to set up the environment.
|
|
10
|
+
5. Save generated test file in the tests directory
|
|
11
|
+
6. Execute the test file and iterate until the test passes
|
|
12
|
+
7. Include appropriate assertions to verify the expected behavior
|
|
13
|
+
8. Structure tests properly with descriptive test titles and comments
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require('dotenv').config();
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const morgan = require('morgan');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const expressLayouts = require('express-ejs-layouts');
|
|
7
|
+
const pm = require('./services/project-manager');
|
|
8
|
+
|
|
9
|
+
const app = express();
|
|
10
|
+
const PORT = process.env.PORT || 4000;
|
|
11
|
+
|
|
12
|
+
app.set('view engine', 'ejs');
|
|
13
|
+
app.set('views', path.join(__dirname, 'views'));
|
|
14
|
+
app.use(expressLayouts);
|
|
15
|
+
app.set('layout', 'layouts/main');
|
|
16
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
17
|
+
app.use(express.urlencoded({ extended: true }));
|
|
18
|
+
app.use(express.json());
|
|
19
|
+
app.use(morgan('dev'));
|
|
20
|
+
|
|
21
|
+
// Serve Allure reports for each registered project
|
|
22
|
+
app.use('/allure-report', (req, res, next) => {
|
|
23
|
+
const projectId = req.query.project;
|
|
24
|
+
const project = projectId ? pm.get(projectId) : pm.getAll()[0];
|
|
25
|
+
if (!project) return res.status(404).send('Project not found');
|
|
26
|
+
|
|
27
|
+
const allureDir = path.join(project.path, 'allure-report');
|
|
28
|
+
if (!fs.existsSync(allureDir)) {
|
|
29
|
+
return res.status(404).send('Allure report not found. Run: npx allure generate allure-results --clean -o allure-report');
|
|
30
|
+
}
|
|
31
|
+
express.static(allureDir)(req, res, next);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
app.use('/', require('./routes/index'));
|
|
35
|
+
app.use('/projects', require('./routes/projects'));
|
|
36
|
+
app.use('/stories', require('./routes/stories'));
|
|
37
|
+
app.use('/runs', require('./routes/runs'));
|
|
38
|
+
app.use('/analytics', require('./routes/analytics'));
|
|
39
|
+
app.use('/export', require('./routes/export'));
|
|
40
|
+
app.use('/data', require('./routes/test-data'));
|
|
41
|
+
|
|
42
|
+
app.use((req, res) => { res.status(404).render('error', { message: 'Page not found' }); });
|
|
43
|
+
|
|
44
|
+
app.listen(PORT, () => {
|
|
45
|
+
console.log(`QA Dashboard running at http://localhost:${PORT}`);
|
|
46
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "qa-dashboard",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI QA Pipeline Dashboard - Interface de pilotage pour pipeline de tests intelligents",
|
|
5
|
+
"main": "app.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node app.js",
|
|
8
|
+
"dev": "node app.js"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"chart.js": "^4.4.0",
|
|
12
|
+
"dotenv": "^16.3.1",
|
|
13
|
+
"ejs": "^3.1.9",
|
|
14
|
+
"express": "^4.18.2",
|
|
15
|
+
"express-ejs-layouts": "^2.5.1",
|
|
16
|
+
"morgan": "^1.10.0"
|
|
17
|
+
}
|
|
18
|
+
}
|