@vibe-validate/extractors 0.16.0 → 0.17.0-rc.5

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.
Files changed (163) hide show
  1. package/dist/extractor-registry.d.ts +104 -0
  2. package/dist/extractor-registry.d.ts.map +1 -0
  3. package/dist/extractor-registry.js +278 -0
  4. package/dist/extractor-registry.js.map +1 -0
  5. package/dist/extractors/ava/index.d.ts +23 -0
  6. package/dist/extractors/ava/index.d.ts.map +1 -0
  7. package/dist/extractors/ava/index.js +507 -0
  8. package/dist/extractors/ava/index.js.map +1 -0
  9. package/dist/extractors/ava/index.test.d.ts +7 -0
  10. package/dist/extractors/ava/index.test.d.ts.map +1 -0
  11. package/dist/extractors/ava/index.test.js +408 -0
  12. package/dist/extractors/ava/index.test.js.map +1 -0
  13. package/dist/extractors/eslint/index.d.ts +18 -0
  14. package/dist/extractors/eslint/index.d.ts.map +1 -0
  15. package/dist/extractors/eslint/index.js +206 -0
  16. package/dist/extractors/eslint/index.js.map +1 -0
  17. package/dist/extractors/eslint/index.test.d.ts +9 -0
  18. package/dist/extractors/eslint/index.test.d.ts.map +1 -0
  19. package/dist/extractors/eslint/index.test.js +191 -0
  20. package/dist/extractors/eslint/index.test.js.map +1 -0
  21. package/dist/extractors/generic/index.d.ts +30 -0
  22. package/dist/extractors/generic/index.d.ts.map +1 -0
  23. package/dist/extractors/generic/index.js +140 -0
  24. package/dist/extractors/generic/index.js.map +1 -0
  25. package/dist/extractors/generic/index.test.d.ts +7 -0
  26. package/dist/extractors/generic/index.test.d.ts.map +1 -0
  27. package/dist/extractors/generic/index.test.js +61 -0
  28. package/dist/extractors/generic/index.test.js.map +1 -0
  29. package/dist/extractors/jasmine/index.d.ts +17 -0
  30. package/dist/extractors/jasmine/index.d.ts.map +1 -0
  31. package/dist/extractors/jasmine/index.js +242 -0
  32. package/dist/extractors/jasmine/index.js.map +1 -0
  33. package/dist/extractors/jasmine/index.test.d.ts +7 -0
  34. package/dist/extractors/jasmine/index.test.d.ts.map +1 -0
  35. package/dist/extractors/jasmine/index.test.js +318 -0
  36. package/dist/extractors/jasmine/index.test.js.map +1 -0
  37. package/dist/extractors/jest/index.d.ts +17 -0
  38. package/dist/extractors/jest/index.d.ts.map +1 -0
  39. package/dist/extractors/jest/index.js +273 -0
  40. package/dist/extractors/jest/index.js.map +1 -0
  41. package/dist/extractors/jest/index.test.d.ts +9 -0
  42. package/dist/extractors/jest/index.test.d.ts.map +1 -0
  43. package/dist/extractors/jest/index.test.js +338 -0
  44. package/dist/extractors/jest/index.test.js.map +1 -0
  45. package/dist/extractors/junit/index.d.ts +18 -0
  46. package/dist/extractors/junit/index.d.ts.map +1 -0
  47. package/dist/extractors/junit/index.js +259 -0
  48. package/dist/extractors/junit/index.js.map +1 -0
  49. package/dist/extractors/junit/index.test.d.ts +7 -0
  50. package/dist/extractors/junit/index.test.d.ts.map +1 -0
  51. package/dist/extractors/junit/index.test.js +341 -0
  52. package/dist/extractors/junit/index.test.js.map +1 -0
  53. package/dist/extractors/maven-checkstyle/index.d.ts +23 -0
  54. package/dist/extractors/maven-checkstyle/index.d.ts.map +1 -0
  55. package/dist/extractors/maven-checkstyle/index.js +263 -0
  56. package/dist/extractors/maven-checkstyle/index.js.map +1 -0
  57. package/dist/extractors/maven-checkstyle/index.test.d.ts +2 -0
  58. package/dist/extractors/maven-checkstyle/index.test.d.ts.map +1 -0
  59. package/dist/extractors/maven-checkstyle/index.test.js +197 -0
  60. package/dist/extractors/maven-checkstyle/index.test.js.map +1 -0
  61. package/dist/extractors/maven-compiler/index.d.ts +23 -0
  62. package/dist/extractors/maven-compiler/index.d.ts.map +1 -0
  63. package/dist/extractors/maven-compiler/index.js +271 -0
  64. package/dist/extractors/maven-compiler/index.js.map +1 -0
  65. package/dist/extractors/maven-compiler/index.test.d.ts +2 -0
  66. package/dist/extractors/maven-compiler/index.test.d.ts.map +1 -0
  67. package/dist/extractors/maven-compiler/index.test.js +189 -0
  68. package/dist/extractors/maven-compiler/index.test.js.map +1 -0
  69. package/dist/extractors/maven-surefire/index.d.ts +23 -0
  70. package/dist/extractors/maven-surefire/index.d.ts.map +1 -0
  71. package/dist/extractors/maven-surefire/index.js +292 -0
  72. package/dist/extractors/maven-surefire/index.js.map +1 -0
  73. package/dist/extractors/maven-surefire/index.test.d.ts +2 -0
  74. package/dist/extractors/maven-surefire/index.test.d.ts.map +1 -0
  75. package/dist/extractors/maven-surefire/index.test.js +163 -0
  76. package/dist/extractors/maven-surefire/index.test.js.map +1 -0
  77. package/dist/extractors/mocha/index.d.ts +17 -0
  78. package/dist/extractors/mocha/index.d.ts.map +1 -0
  79. package/dist/extractors/mocha/index.js +241 -0
  80. package/dist/extractors/mocha/index.js.map +1 -0
  81. package/dist/extractors/mocha/index.test.d.ts +7 -0
  82. package/dist/extractors/mocha/index.test.d.ts.map +1 -0
  83. package/dist/extractors/mocha/index.test.js +300 -0
  84. package/dist/extractors/mocha/index.test.js.map +1 -0
  85. package/dist/extractors/playwright/index.d.ts +17 -0
  86. package/dist/extractors/playwright/index.d.ts.map +1 -0
  87. package/dist/extractors/playwright/index.js +320 -0
  88. package/dist/extractors/playwright/index.js.map +1 -0
  89. package/dist/extractors/playwright/index.test.d.ts +7 -0
  90. package/dist/extractors/playwright/index.test.d.ts.map +1 -0
  91. package/dist/extractors/playwright/index.test.js +274 -0
  92. package/dist/extractors/playwright/index.test.js.map +1 -0
  93. package/dist/extractors/tap/index.d.ts +23 -0
  94. package/dist/extractors/tap/index.d.ts.map +1 -0
  95. package/dist/extractors/tap/index.js +352 -0
  96. package/dist/extractors/tap/index.js.map +1 -0
  97. package/dist/extractors/tap/index.test.d.ts +7 -0
  98. package/dist/extractors/tap/index.test.d.ts.map +1 -0
  99. package/dist/extractors/tap/index.test.js +100 -0
  100. package/dist/extractors/tap/index.test.js.map +1 -0
  101. package/dist/extractors/typescript/index.d.ts +17 -0
  102. package/dist/extractors/typescript/index.d.ts.map +1 -0
  103. package/dist/extractors/typescript/index.js +150 -0
  104. package/dist/extractors/typescript/index.js.map +1 -0
  105. package/dist/extractors/typescript/index.test.d.ts +9 -0
  106. package/dist/extractors/typescript/index.test.d.ts.map +1 -0
  107. package/dist/extractors/typescript/index.test.js +177 -0
  108. package/dist/extractors/typescript/index.test.js.map +1 -0
  109. package/dist/extractors/vitest/index.d.ts +17 -0
  110. package/dist/extractors/vitest/index.d.ts.map +1 -0
  111. package/dist/extractors/vitest/index.js +564 -0
  112. package/dist/extractors/vitest/index.js.map +1 -0
  113. package/dist/extractors/vitest/index.test.d.ts +9 -0
  114. package/dist/extractors/vitest/index.test.d.ts.map +1 -0
  115. package/dist/extractors/vitest/index.test.js +373 -0
  116. package/dist/extractors/vitest/index.test.js.map +1 -0
  117. package/dist/index.d.ts +27 -11
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +27 -11
  120. package/dist/index.js.map +1 -1
  121. package/dist/maven-checkstyle-extractor.d.ts +20 -0
  122. package/dist/maven-checkstyle-extractor.d.ts.map +1 -0
  123. package/dist/maven-checkstyle-extractor.js +193 -0
  124. package/dist/maven-checkstyle-extractor.js.map +1 -0
  125. package/dist/maven-compiler-extractor.d.ts +20 -0
  126. package/dist/maven-compiler-extractor.d.ts.map +1 -0
  127. package/dist/maven-compiler-extractor.js +218 -0
  128. package/dist/maven-compiler-extractor.js.map +1 -0
  129. package/dist/maven-surefire-extractor.d.ts +20 -0
  130. package/dist/maven-surefire-extractor.d.ts.map +1 -0
  131. package/dist/maven-surefire-extractor.js +228 -0
  132. package/dist/maven-surefire-extractor.js.map +1 -0
  133. package/dist/maven-utils.d.ts +24 -0
  134. package/dist/maven-utils.d.ts.map +1 -0
  135. package/dist/maven-utils.js +36 -0
  136. package/dist/maven-utils.js.map +1 -0
  137. package/dist/plugin-loader.d.ts +82 -0
  138. package/dist/plugin-loader.d.ts.map +1 -0
  139. package/dist/plugin-loader.js +200 -0
  140. package/dist/plugin-loader.js.map +1 -0
  141. package/dist/sandbox.d.ts +161 -0
  142. package/dist/sandbox.d.ts.map +1 -0
  143. package/dist/sandbox.js +254 -0
  144. package/dist/sandbox.js.map +1 -0
  145. package/dist/sandbox.test.d.ts +8 -0
  146. package/dist/sandbox.test.d.ts.map +1 -0
  147. package/dist/sandbox.test.js +395 -0
  148. package/dist/sandbox.test.js.map +1 -0
  149. package/dist/sandboxed-extractor.d.ts +46 -0
  150. package/dist/sandboxed-extractor.d.ts.map +1 -0
  151. package/dist/sandboxed-extractor.js +172 -0
  152. package/dist/sandboxed-extractor.js.map +1 -0
  153. package/dist/sandboxed-extractor.test.d.ts +5 -0
  154. package/dist/sandboxed-extractor.test.d.ts.map +1 -0
  155. package/dist/sandboxed-extractor.test.js +346 -0
  156. package/dist/sandboxed-extractor.test.js.map +1 -0
  157. package/dist/smart-extractor.d.ts +22 -10
  158. package/dist/smart-extractor.d.ts.map +1 -1
  159. package/dist/smart-extractor.js +116 -163
  160. package/dist/smart-extractor.js.map +1 -1
  161. package/dist/types.d.ts +94 -0
  162. package/dist/types.d.ts.map +1 -1
  163. package/package.json +2 -1
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Playwright Error Extractor Plugin
3
+ *
4
+ * Parses and formats Playwright test output for LLM consumption.
5
+ *
6
+ * @package @vibe-validate/extractors
7
+ */
8
+ /**
9
+ * Detect error type from error message and block
10
+ */
11
+ function detectErrorType(message, block) {
12
+ // Element not found (waiting for locator with timeout)
13
+ // Check this BEFORE generic timeout to avoid false positives
14
+ if (block.includes('waiting for locator') && (message.includes('timeout') || message.includes('exceeded'))) {
15
+ return 'element-not-found';
16
+ }
17
+ // Navigation errors
18
+ if (message.includes('net::ERR') || message.includes('page.goto:')) {
19
+ return 'navigation-error';
20
+ }
21
+ // Timeout errors (generic)
22
+ if (message.includes('timeout') || message.includes('exceeded')) {
23
+ return 'timeout';
24
+ }
25
+ // Assertion errors (expect())
26
+ if (message.includes('expect(') ||
27
+ message.includes('toBe') ||
28
+ message.includes('toContain') ||
29
+ message.includes('toBeVisible') ||
30
+ message.includes('toHaveValue') ||
31
+ message.includes('toHaveCount')) {
32
+ return 'assertion-error';
33
+ }
34
+ // Generic error
35
+ return 'error';
36
+ }
37
+ /**
38
+ * Generate guidance for common error types
39
+ */
40
+ function generateGuidance(type, _message) {
41
+ switch (type) {
42
+ case 'assertion-error':
43
+ return 'Check the assertion expectation and ensure the actual value matches. Review the test logic and the application state.';
44
+ case 'timeout':
45
+ return 'The operation exceeded the timeout limit. Consider increasing the timeout, checking for slow operations, or verifying the application is responding correctly.';
46
+ case 'element-not-found':
47
+ return 'The element was not found on the page. Verify the selector is correct, the element exists, and it is rendered when expected.';
48
+ case 'navigation-error':
49
+ return 'Failed to navigate to the page. Check the URL is correct, the server is running, and the page exists.';
50
+ default:
51
+ return undefined;
52
+ }
53
+ }
54
+ /**
55
+ * Calculate quality metadata
56
+ */
57
+ function calculateQualityMetadata(errors, issues) {
58
+ if (errors.length === 0 && issues.length === 0) {
59
+ // No errors and no issues = perfect extraction (or no failures)
60
+ return {
61
+ confidence: 100,
62
+ completeness: 100,
63
+ issues: [],
64
+ };
65
+ }
66
+ // Calculate completeness: % of errors with file + line + message
67
+ const completeErrors = errors.filter(e => e.file &&
68
+ e.line !== undefined &&
69
+ e.line > 0 &&
70
+ e.message).length;
71
+ const completeness = errors.length > 0
72
+ ? Math.round((completeErrors / errors.length) * 100)
73
+ : 100;
74
+ // Calculate confidence based on pattern matching quality
75
+ let confidence = 90; // Base confidence for Playwright (distinctive format)
76
+ // Reduce confidence if we have issues
77
+ if (issues.length > 0) {
78
+ confidence -= Math.min(issues.length * 10, 40);
79
+ }
80
+ // Reduce confidence if completeness is low
81
+ if (completeness < 80) {
82
+ confidence -= (100 - completeness) / 2;
83
+ }
84
+ confidence = Math.max(0, Math.min(100, confidence));
85
+ return {
86
+ confidence: Math.round(confidence),
87
+ completeness,
88
+ issues,
89
+ };
90
+ }
91
+ /**
92
+ * Extract errors from Playwright test output
93
+ *
94
+ * @param output - Playwright text output
95
+ * @returns Structured error information
96
+ */
97
+ // eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 22 acceptable for Playwright output parsing (handles numbered failures, error blocks, and file path normalization)
98
+ function extract(output) {
99
+ const errors = [];
100
+ const issues = [];
101
+ // Split into lines for processing
102
+ const lines = output.split('\n');
103
+ // Parse numbered failure blocks: " 1) tests/path/test.spec.ts:10:5 › test name"
104
+ let i = 0;
105
+ while (i < lines.length) {
106
+ const line = lines[i];
107
+ // Match numbered failure header: " 1) tests/path/test.spec.ts:10:5 › test name"
108
+ // File path can include directories: "tests/playwright/test.spec.ts" or just "test.spec.ts"
109
+ // Allow trailing whitespace
110
+ // eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Playwright test framework output (controlled output), not user input
111
+ const failureMatch = /^\s+(\d+)\)\s+(.*\.spec\.ts):(\d+):(\d+)\s+›\s+(.+?)\s*$/.exec(line);
112
+ if (failureMatch) {
113
+ const [, , file, , , testName] = failureMatch;
114
+ // Extract error block (everything until next numbered failure or end)
115
+ const errorLines = [];
116
+ i++;
117
+ while (i < lines.length) {
118
+ const nextLine = lines[i];
119
+ // Stop at next numbered failure
120
+ if (/^\s+\d+\)\s+/.exec(nextLine)) {
121
+ break;
122
+ }
123
+ errorLines.push(nextLine);
124
+ i++;
125
+ }
126
+ // Parse the error block
127
+ const errorBlock = errorLines.join('\n');
128
+ // Extract error message (first Error: line and subsequent details)
129
+ // eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Playwright test framework error messages (controlled output), not user input
130
+ const errorMessageMatch = /Error:\s*(.+?)(?:\n\n|\n(?=\s+at\s))/s.exec(errorBlock);
131
+ const errorMessage = errorMessageMatch ? errorMessageMatch[1].trim() : testName;
132
+ // Extract file location from stack trace (last line with "at file:line:col")
133
+ // eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Playwright test framework stack traces (controlled output), not user input
134
+ const stackMatch = /at\s+(.*\.spec\.ts):(\d+):(\d+)/.exec(errorBlock);
135
+ let errorFile = file;
136
+ let errorLine = 0;
137
+ let errorColumn = 0;
138
+ if (stackMatch) {
139
+ errorFile = stackMatch[1];
140
+ errorLine = Number.parseInt(stackMatch[2], 10);
141
+ errorColumn = Number.parseInt(stackMatch[3], 10);
142
+ }
143
+ else {
144
+ // No stack trace found - track as an issue
145
+ issues.push(`No stack trace found for failure: ${testName}`);
146
+ }
147
+ // Normalize file path (remove absolute path prefix if present, keep relative paths)
148
+ // If it's an absolute path, extract just the tests/... part or the filename
149
+ if (errorFile.includes('/') && !errorFile.startsWith('tests')) {
150
+ // Absolute path - extract relative part
151
+ const testsMatch = /(tests?\/.+\.spec\.ts)/i.exec(errorFile);
152
+ if (testsMatch) {
153
+ errorFile = testsMatch[1];
154
+ }
155
+ else {
156
+ // Just keep filename if no tests/ path found
157
+ errorFile = errorFile.replace(/^.*\/([^/]+\.spec\.ts)$/i, '$1');
158
+ }
159
+ }
160
+ // If it already starts with tests/ or is just a filename, keep it as-is
161
+ // Detect error type
162
+ const type = detectErrorType(errorMessage, errorBlock);
163
+ // Generate guidance
164
+ const guidance = generateGuidance(type, errorMessage);
165
+ // Build complete error message
166
+ const completeMessage = `${testName}\n${errorMessage}`;
167
+ errors.push({
168
+ file: errorFile,
169
+ line: errorLine,
170
+ column: errorColumn,
171
+ message: completeMessage,
172
+ context: testName,
173
+ guidance,
174
+ });
175
+ }
176
+ else {
177
+ i++;
178
+ }
179
+ }
180
+ // Calculate quality metadata
181
+ const metadata = calculateQualityMetadata(errors, issues);
182
+ // Generate summary
183
+ const summary = errors.length > 0
184
+ ? `${errors.length} test(s) failed`
185
+ : '0 test(s) failed';
186
+ // Generate guidance
187
+ const guidance = errors.length > 0
188
+ ? 'Review test failures and fix the underlying issues. Check assertions, selectors, and test logic.'
189
+ : '';
190
+ // Generate clean output
191
+ const formattedOutput = errors
192
+ .map(e => {
193
+ const location = e.file && e.line ? `${e.file}:${e.line}` : e.file ?? 'unknown';
194
+ return `${location}: ${e.message}`;
195
+ })
196
+ .join('\n');
197
+ return {
198
+ errors,
199
+ summary,
200
+ totalErrors: errors.length,
201
+ guidance,
202
+ errorSummary: formattedOutput,
203
+ metadata,
204
+ };
205
+ }
206
+ /**
207
+ * Detect if output is from Playwright test framework
208
+ *
209
+ * @param output - Command output to analyze
210
+ * @returns Detection result with confidence and patterns
211
+ */
212
+ function detect(output) {
213
+ // Playwright uses ✘ symbol and .spec.ts files
214
+ const hasPlaywrightMarker = output.includes('✘') && output.includes('.spec.ts');
215
+ // Or has numbered failures with › separator
216
+ // eslint-disable-next-line sonarjs/slow-regex -- Safe: only tests Playwright output format (controlled test framework output), not user input
217
+ const hasNumberedFailures = /^\s+\d+\)\s+.+\.spec\.ts:\d+:\d+\s+›/.test(output);
218
+ if (hasPlaywrightMarker || hasNumberedFailures) {
219
+ return {
220
+ confidence: 90,
221
+ patterns: ['✘ + .spec.ts pattern', '› separator'],
222
+ reason: 'Playwright test framework output detected',
223
+ };
224
+ }
225
+ return { confidence: 0, patterns: [], reason: '' };
226
+ }
227
+ /**
228
+ * Sample test cases for Playwright extractor
229
+ */
230
+ const samples = [
231
+ {
232
+ name: 'single-assertion-error',
233
+ description: 'Single Playwright test failure with assertion error',
234
+ input: `
235
+ Running 1 test using 1 worker
236
+
237
+ ✘ 1 tests/example.spec.ts:10:5 › should fail (100ms)
238
+
239
+
240
+ 1) tests/example.spec.ts:10:5 › should fail
241
+
242
+ Error: expect(received).toBe(expected)
243
+
244
+ Expected: "foo"
245
+ Received: "bar"
246
+
247
+ 10 | test('should fail', async () => {
248
+ 11 | const value = 'bar';
249
+ > 12 | expect(value).toBe('foo');
250
+ | ^
251
+ 13 | });
252
+
253
+ at tests/example.spec.ts:12:21
254
+
255
+ 1 failed
256
+ `,
257
+ expectedErrors: 1,
258
+ expectedPatterns: ['expect(received).toBe(expected)', 'should fail'],
259
+ },
260
+ {
261
+ name: 'multiple-test-failures',
262
+ description: 'Multiple Playwright test failures with different error types',
263
+ input: `
264
+ Running 3 tests using 1 worker
265
+
266
+ ✘ 1 tests/example.spec.ts:10:5 › first failure (100ms)
267
+ ✘ 2 tests/example.spec.ts:20:5 › second failure (150ms)
268
+ ✘ 3 tests/example.spec.ts:30:5 › third failure (200ms)
269
+
270
+
271
+ 1) tests/example.spec.ts:10:5 › first failure
272
+
273
+ Error: First error
274
+
275
+ at tests/example.spec.ts:12:21
276
+
277
+ 2) tests/example.spec.ts:20:5 › second failure
278
+
279
+ Error: Second error
280
+
281
+ at tests/example.spec.ts:22:21
282
+
283
+ 3) tests/example.spec.ts:30:5 › third failure
284
+
285
+ Error: Third error
286
+
287
+ at tests/example.spec.ts:32:21
288
+
289
+ 3 failed
290
+ `,
291
+ expectedErrors: 3,
292
+ expectedPatterns: ['First error', 'Second error', 'Third error'],
293
+ },
294
+ ];
295
+ /**
296
+ * Playwright Error Extractor Plugin
297
+ *
298
+ * Extracts Playwright test framework errors with 90% confidence.
299
+ * Parses numbered failures with › separator and .spec.ts files.
300
+ */
301
+ const playwrightPlugin = {
302
+ metadata: {
303
+ name: 'playwright',
304
+ version: '1.0.0',
305
+ author: 'vibe-validate',
306
+ description: 'Extracts Playwright test framework errors',
307
+ repository: 'https://github.com/jdutton/vibe-validate',
308
+ tags: ['playwright', 'testing', 'javascript', 'e2e'],
309
+ },
310
+ hints: {
311
+ required: ['.spec.ts'],
312
+ anyOf: ['✘', '›'],
313
+ },
314
+ priority: 90,
315
+ detect,
316
+ extract,
317
+ samples,
318
+ };
319
+ export default playwrightPlugin;
320
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extractors/playwright/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH;;GAEG;AACH,SAAS,eAAe,CAAC,OAAe,EAAE,KAAa;IACrD,uDAAuD;IACvD,6DAA6D;IAC7D,IAAI,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,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AC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC;KACrD;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;KAClB;IACD,QAAQ,EAAE,EAAE;IACZ,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Playwright Error Extractor Plugin Tests
3
+ *
4
+ * @package @vibe-validate/extractors
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/extractors/playwright/index.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Playwright Error Extractor Plugin Tests
3
+ *
4
+ * @package @vibe-validate/extractors
5
+ */
6
+ import { describe, it, expect } from 'vitest';
7
+ import playwrightPlugin from './index.js';
8
+ describe('playwright extractor plugin', () => {
9
+ describe('detect', () => {
10
+ it('should detect Playwright output with ✘ marker', () => {
11
+ const output = `
12
+ ✘ 1 tests/example.spec.ts:10:5 › should fail (100ms)
13
+ `;
14
+ const result = playwrightPlugin.detect(output);
15
+ expect(result.confidence).toBe(90);
16
+ expect(result.reason).toContain('Playwright');
17
+ });
18
+ it('should detect Playwright output with numbered failures', () => {
19
+ const output = `
20
+ 1) tests/example.spec.ts:10:5 › test name
21
+ `;
22
+ const result = playwrightPlugin.detect(output);
23
+ expect(result.confidence).toBe(90);
24
+ });
25
+ it('should not detect non-Playwright output', () => {
26
+ const output = 'Some random text without Playwright patterns';
27
+ const result = playwrightPlugin.detect(output);
28
+ expect(result.confidence).toBe(0);
29
+ });
30
+ });
31
+ describe('extract', () => {
32
+ describe('Basic Extraction', () => {
33
+ it('should extract single failure', () => {
34
+ const output = `
35
+ Running 1 test using 1 worker
36
+
37
+ ✘ 1 tests/example.spec.ts:10:5 › should fail (100ms)
38
+
39
+
40
+ 1) tests/example.spec.ts:10:5 › should fail
41
+
42
+ Error: expect(received).toBe(expected)
43
+
44
+ Expected: "foo"
45
+ Received: "bar"
46
+
47
+ 10 | test('should fail', async () => {
48
+ 11 | const value = 'bar';
49
+ > 12 | expect(value).toBe('foo');
50
+ | ^
51
+ 13 | });
52
+
53
+ at tests/example.spec.ts:12:21
54
+
55
+ 1 failed
56
+ `;
57
+ const result = playwrightPlugin.extract(output);
58
+ expect(result.errors).toHaveLength(1);
59
+ expect(result.errors[0]).toMatchObject({
60
+ file: 'tests/example.spec.ts',
61
+ line: 12,
62
+ column: 21,
63
+ message: expect.stringContaining('expect(received).toBe(expected)'),
64
+ });
65
+ expect(result.errors[0].guidance).toContain('assertion');
66
+ });
67
+ it('should extract multiple failures', () => {
68
+ const output = `
69
+ Running 3 tests using 1 worker
70
+
71
+ ✘ 1 tests/example.spec.ts:10:5 › first failure (100ms)
72
+ ✘ 2 tests/example.spec.ts:20:5 › second failure (150ms)
73
+ ✘ 3 tests/example.spec.ts:30:5 › third failure (200ms)
74
+
75
+
76
+ 1) tests/example.spec.ts:10:5 › first failure
77
+
78
+ Error: First error
79
+
80
+ at tests/example.spec.ts:12:21
81
+
82
+ 2) tests/example.spec.ts:20:5 › second failure
83
+
84
+ Error: Second error
85
+
86
+ at tests/example.spec.ts:22:21
87
+
88
+ 3) tests/example.spec.ts:30:5 › third failure
89
+
90
+ Error: Third error
91
+
92
+ at tests/example.spec.ts:32:21
93
+
94
+ 3 failed
95
+ `;
96
+ const result = playwrightPlugin.extract(output);
97
+ expect(result.errors).toHaveLength(3);
98
+ expect(result.errors[0].message).toContain('First error');
99
+ expect(result.errors[1].message).toContain('Second error');
100
+ expect(result.errors[2].message).toContain('Third error');
101
+ });
102
+ it('should return empty array when no failures', () => {
103
+ const output = `
104
+ Running 5 tests using 2 workers
105
+
106
+ ✓ tests/example.spec.ts:10:5 › test passes (100ms)
107
+
108
+ 5 passed (1.2s)
109
+ `;
110
+ const result = playwrightPlugin.extract(output);
111
+ expect(result.errors).toHaveLength(0);
112
+ expect(result.metadata.completeness).toBe(100);
113
+ });
114
+ });
115
+ describe('Error Type Detection', () => {
116
+ it('should detect assertion errors', () => {
117
+ const output = `
118
+ 1) tests/test.spec.ts:10:5 › assertion test
119
+
120
+ Error: expect(received).toBe(expected)
121
+
122
+ at tests/test.spec.ts:12:21
123
+ `;
124
+ const result = playwrightPlugin.extract(output);
125
+ expect(result.errors[0].guidance).toContain('assertion');
126
+ });
127
+ it('should detect timeout errors', () => {
128
+ const output = `
129
+ 1) tests/test.spec.ts:10:5 › timeout test
130
+
131
+ Test timeout of 30000ms exceeded.
132
+
133
+ Error: page.click: Test timeout of 30000ms exceeded.
134
+
135
+ at tests/test.spec.ts:12:18
136
+ `;
137
+ const result = playwrightPlugin.extract(output);
138
+ expect(result.errors[0].guidance).toContain('timeout');
139
+ });
140
+ it('should detect element not found errors', () => {
141
+ const output = `
142
+ 1) tests/test.spec.ts:10:5 › element not found
143
+
144
+ Error: page.click: Test timeout of 30000ms exceeded.
145
+ Call log:
146
+ - waiting for locator('#nonexistent')
147
+
148
+ at tests/test.spec.ts:12:18
149
+ `;
150
+ const result = playwrightPlugin.extract(output);
151
+ expect(result.errors[0].guidance).toContain('element');
152
+ });
153
+ it('should detect navigation errors', () => {
154
+ const output = `
155
+ 1) tests/test.spec.ts:10:5 › navigation error
156
+
157
+ Error: page.goto: net::ERR_FILE_NOT_FOUND at file:///nonexistent.html
158
+
159
+ at tests/test.spec.ts:12:18
160
+ `;
161
+ const result = playwrightPlugin.extract(output);
162
+ expect(result.errors[0].guidance).toContain('navigate');
163
+ });
164
+ });
165
+ describe('Location Extraction', () => {
166
+ it('should extract file, line, and column from stack trace', () => {
167
+ const output = `
168
+ 1) tests/deep/nested/test.spec.ts:42:7 › failure
169
+
170
+ Error: Test error
171
+
172
+ at tests/deep/nested/test.spec.ts:45:23
173
+ `;
174
+ const result = playwrightPlugin.extract(output);
175
+ expect(result.errors[0]).toMatchObject({
176
+ file: 'tests/deep/nested/test.spec.ts',
177
+ line: 45,
178
+ column: 23,
179
+ });
180
+ });
181
+ it('should handle absolute paths in error location', () => {
182
+ const output = `
183
+ 1) tests/test.spec.ts:10:5 › failure
184
+
185
+ Error: Test error
186
+
187
+ at /Users/jeff/project/tests/test.spec.ts:12:21
188
+ `;
189
+ const result = playwrightPlugin.extract(output);
190
+ expect(result.errors[0].file).toMatch(/test\.spec\.ts$/);
191
+ expect(result.errors[0].line).toBe(12);
192
+ expect(result.errors[0].column).toBe(21);
193
+ });
194
+ });
195
+ describe('Test Hierarchy', () => {
196
+ it('should preserve test hierarchy from summary line', () => {
197
+ const output = `
198
+ ✘ 1 tests/test.spec.ts:10:5 › Outer Describe › Inner Describe › test name (100ms)
199
+
200
+ 1) tests/test.spec.ts:10:5 › Outer Describe › Inner Describe › test name
201
+
202
+ Error: Test failed
203
+
204
+ at tests/test.spec.ts:12:21
205
+ `;
206
+ const result = playwrightPlugin.extract(output);
207
+ expect(result.errors[0].message).toContain('Outer Describe › Inner Describe › test name');
208
+ });
209
+ });
210
+ describe('Quality Metadata', () => {
211
+ it('should report confidence level', () => {
212
+ const output = `
213
+ 1) tests/test.spec.ts:10:5 › test
214
+
215
+ Error: Test error
216
+
217
+ at tests/test.spec.ts:12:21
218
+ `;
219
+ const result = playwrightPlugin.extract(output);
220
+ expect(result.metadata.confidence).toBeGreaterThan(0);
221
+ expect(result.metadata.confidence).toBeLessThanOrEqual(100);
222
+ });
223
+ it('should report issues when extraction has problems', () => {
224
+ const output = `
225
+ 1) tests/test.spec.ts:10:5 › failure without stack trace
226
+
227
+ Error: Some error message
228
+ Expected: foo
229
+ Received: bar
230
+
231
+ 2) tests/test.spec.ts:20:5 › another failure without stack
232
+
233
+ Error: Another error
234
+ `;
235
+ const result = playwrightPlugin.extract(output);
236
+ // Should extract both failures
237
+ expect(result.errors.length).toBe(2);
238
+ // Should report issues for missing stack traces
239
+ expect(result.metadata.issues).toBeDefined();
240
+ expect(result.metadata.issues.length).toBe(2);
241
+ expect(result.metadata.issues[0]).toContain('No stack trace');
242
+ });
243
+ });
244
+ });
245
+ describe('samples', () => {
246
+ it('should have at least 2 sample test cases', () => {
247
+ expect(playwrightPlugin.samples).toBeDefined();
248
+ expect(playwrightPlugin.samples.length).toBeGreaterThanOrEqual(2);
249
+ });
250
+ it('should successfully parse all sample inputs', () => {
251
+ for (const sample of playwrightPlugin.samples) {
252
+ const result = playwrightPlugin.extract(sample.input);
253
+ expect(result.errors.length).toBeGreaterThan(0);
254
+ expect(result.errors.length).toBe(sample.expectedErrors);
255
+ }
256
+ });
257
+ });
258
+ describe('metadata', () => {
259
+ it('should have complete plugin metadata', () => {
260
+ expect(playwrightPlugin.metadata.name).toBe('playwright');
261
+ expect(playwrightPlugin.metadata.version).toBe('1.0.0');
262
+ expect(playwrightPlugin.metadata.description).toBeTruthy();
263
+ expect(playwrightPlugin.metadata.tags).toContain('playwright');
264
+ });
265
+ it('should have appropriate priority', () => {
266
+ expect(playwrightPlugin.priority).toBe(90);
267
+ });
268
+ it('should have detection hints', () => {
269
+ expect(playwrightPlugin.hints.required).toContain('.spec.ts');
270
+ expect(playwrightPlugin.hints.anyOf).toContain('✘');
271
+ });
272
+ });
273
+ });
274
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/extractors/playwright/index.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAE1C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,MAAM,GAAG;;CA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AAE;YAC1C,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACrC,MAAM,CAAC,gBAAgB,CAAC,KAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC/D,MAAM,CAAC,gBAAgB,CAAC,KAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * TAP Error Extractor Plugin
3
+ *
4
+ * Parses TAP (Test Anything Protocol) test output and formats failures for LLM consumption.
5
+ * Supports TAP version 13 and compatible test frameworks (tape, node-tap, etc.)
6
+ *
7
+ * @package @vibe-validate/extractors
8
+ */
9
+ import type { ExtractorPlugin, DetectionResult, ErrorExtractorResult } from '../../types.js';
10
+ /**
11
+ * Detects if output is from TAP protocol
12
+ */
13
+ export declare function detectTAP(output: string): DetectionResult;
14
+ /**
15
+ * Extract errors from TAP test output
16
+ */
17
+ export declare function extractTAP(output: string, _command?: string): ErrorExtractorResult;
18
+ /**
19
+ * TAP Extractor Plugin
20
+ */
21
+ declare const tapExtractor: ExtractorPlugin;
22
+ export default tapExtractor;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extractors/tap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,oBAAoB,EAGrB,MAAM,gBAAgB,CAAC;AA2CxB;;GAEG;AAEH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAwDzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAkGlF;AAmID;;GAEG;AACH,QAAA,MAAM,YAAY,EAAE,eA2DnB,CAAC;AAEF,eAAe,YAAY,CAAC"}