playwright-ai-insights 1.2.14 → 1.3.1
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/README.md +86 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,11 +70,14 @@ import { test, expect } from '@playwright/test';
|
|
|
70
70
|
import { test, expect } from './fixtures/aiHooks.js';
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
### 3. Analyze Test Failures
|
|
73
|
+
### 3. Analyze Test Failures & Generate Reports
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
# After tests run
|
|
77
|
-
|
|
76
|
+
# After tests run, generate an AI-powered HTML report
|
|
77
|
+
npx playwright-ai report
|
|
78
|
+
|
|
79
|
+
# Report will be created at: reports/ai-insights-report.html
|
|
80
|
+
# Open it in your browser to see AI insights and suggestions
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
### API Usage Examples
|
|
@@ -139,6 +142,12 @@ npx playwright-ai setup
|
|
|
139
142
|
# Reconfigure or re-run setup
|
|
140
143
|
npx playwright-ai setup --force
|
|
141
144
|
|
|
145
|
+
# Generate AI-Powered Test Failure Report (HTML)
|
|
146
|
+
npx playwright-ai report
|
|
147
|
+
|
|
148
|
+
# Generate report with custom paths
|
|
149
|
+
npx playwright-ai report --results=./custom-results.json --output=./custom-report.html
|
|
150
|
+
|
|
142
151
|
# Add AI section to README
|
|
143
152
|
npx playwright-ai add-docs
|
|
144
153
|
|
|
@@ -155,6 +164,30 @@ npx playwright-ai analyze --results=./test-results.json
|
|
|
155
164
|
npx playwright-ai version
|
|
156
165
|
```
|
|
157
166
|
|
|
167
|
+
### Generating AI-Powered Test Reports
|
|
168
|
+
|
|
169
|
+
After your tests run and generate a results JSON file, generate an intelligent HTML report:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Generate report with default paths
|
|
173
|
+
# Expects: reports/test-results.json
|
|
174
|
+
# Creates: reports/ai-insights-report.html
|
|
175
|
+
npx playwright-ai report
|
|
176
|
+
|
|
177
|
+
# Generate report with custom input/output paths
|
|
178
|
+
npx playwright-ai report --results=path/to/results.json --output=path/to/report.html
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Report Features:**
|
|
182
|
+
- 📊 Test failure statistics and trends
|
|
183
|
+
- 🤖 AI-powered root cause analysis
|
|
184
|
+
- 💡 Intelligent locator suggestions with confidence scores
|
|
185
|
+
- 📈 Test run history with pass/fail status
|
|
186
|
+
- 🎯 Failure type classification (Assertion, Timeout, etc.)
|
|
187
|
+
- 🔴 Recent run status with hover tooltips
|
|
188
|
+
|
|
189
|
+
**Report Output:** `reports/ai-insights-report.html` (open in browser)
|
|
190
|
+
|
|
158
191
|
### Environment Variables
|
|
159
192
|
|
|
160
193
|
```bash
|
|
@@ -174,6 +207,56 @@ ENABLE_FLAKY_DETECTION=true
|
|
|
174
207
|
ENABLE_SCREENSHOTS=true
|
|
175
208
|
```
|
|
176
209
|
|
|
210
|
+
### HTML Reports - AI-Powered Test Failure Analysis
|
|
211
|
+
|
|
212
|
+
Generate beautiful HTML reports with AI-powered insights for all test failures:
|
|
213
|
+
|
|
214
|
+
**Basic Usage (Recommended):**
|
|
215
|
+
```bash
|
|
216
|
+
# Prerequisites:
|
|
217
|
+
# - Your test results in reports/test-results.json
|
|
218
|
+
# - OPENAI_API_KEY environment variable set
|
|
219
|
+
|
|
220
|
+
npx playwright-ai report
|
|
221
|
+
# Output: reports/ai-insights-report.html
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Advanced Usage:**
|
|
225
|
+
```bash
|
|
226
|
+
# Custom input and output paths
|
|
227
|
+
npx playwright-ai report \
|
|
228
|
+
--results=path/to/your/results.json \
|
|
229
|
+
--output=path/to/your/report.html
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**What's in the Report:**
|
|
233
|
+
- 📊 **Summary Statistics** - Total failed tests, flaky test count, report date
|
|
234
|
+
- 🤖 **AI Root Cause Analysis** - Why each test failed (Assertion, Timeout, etc.)
|
|
235
|
+
- 💡 **Smart Suggestions** - AI-recommended fixes with confidence scores
|
|
236
|
+
- 📈 **Test History** - Pass/fail trends with recent run status
|
|
237
|
+
- 🎯 **Confidence Scores** - AI's confidence in each suggestion (0-100%)
|
|
238
|
+
- 🔴 **Status Indicators** - Visual markers for each test failure type
|
|
239
|
+
|
|
240
|
+
**Example Report Output:**
|
|
241
|
+
```
|
|
242
|
+
AI-Powered Test Failure Report
|
|
243
|
+
Intelligent Test Failure Diagnostics
|
|
244
|
+
|
|
245
|
+
1 Failed Tests | 1 Potentially Flaky | Report Date: 11-Mar-2026
|
|
246
|
+
|
|
247
|
+
Test Failure Analysis
|
|
248
|
+
┌─────────────────────────────────────────────────────────┐
|
|
249
|
+
│ # │ Test Name │ Type │ AI Suggestion │ ⭐ │
|
|
250
|
+
├─────────────────────────────────────────────────────────┤
|
|
251
|
+
│ 1 │ Login Test │ ⏱ Timeout │ Use waitFor() │ 85% │
|
|
252
|
+
│ 2 │ Submit Form │ 🟠 Assert │ Update CSS │ 92% │
|
|
253
|
+
└─────────────────────────────────────────────────────────┘
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Default Paths:**
|
|
257
|
+
- **Input:** `reports/test-results.json` (standard Playwright test results)
|
|
258
|
+
- **Output:** `reports/ai-insights-report.html` (open in browser)
|
|
259
|
+
|
|
177
260
|
### Using AI Fixtures in Tests
|
|
178
261
|
|
|
179
262
|
```javascript
|
package/package.json
CHANGED