@matware/e2e-runner 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matware/e2e-runner",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "mcpName": "io.github.fastslack/e2e-runner",
5
5
  "description": "E2E test runner using Chrome Pool (browserless/chrome) with parallel execution",
6
6
  "type": "module",
package/src/mcp-server.js CHANGED
@@ -241,8 +241,17 @@ async function handleRun(args) {
241
241
  reportPath: path.join(config.screenshotsDir, 'report.json'),
242
242
  };
243
243
 
244
+ const consoleErrors = report.results
245
+ .filter(r => r.consoleLogs?.some(l => l.type === 'error' || l.type === 'warning'))
246
+ .map(r => ({ name: r.name, logs: r.consoleLogs.filter(l => l.type === 'error' || l.type === 'warning') }));
247
+ const networkErrors = report.results
248
+ .filter(r => r.networkErrors?.length > 0)
249
+ .map(r => ({ name: r.name, errors: r.networkErrors }));
250
+
244
251
  if (flaky.length > 0) summary.flaky = flaky;
245
252
  if (failures.length > 0) summary.failures = failures;
253
+ if (consoleErrors.length > 0) summary.consoleErrors = consoleErrors;
254
+ if (networkErrors.length > 0) summary.networkErrors = networkErrors;
246
255
 
247
256
  return textResult(JSON.stringify(summary, null, 2));
248
257
  }
package/src/reporter.js CHANGED
@@ -55,6 +55,11 @@ export function generateJUnitXML(report) {
55
55
  xml += ` <system-out><![CDATA[${logs}]]></system-out>\n`;
56
56
  }
57
57
 
58
+ const netErrors = (result.networkErrors || []).map(e => `[${e.error || 'unknown'}] ${e.url}`).join('\n');
59
+ if (netErrors) {
60
+ xml += ` <system-err><![CDATA[${netErrors}]]></system-err>\n`;
61
+ }
62
+
58
63
  xml += ' </testcase>\n';
59
64
  }
60
65
 
@@ -109,6 +114,31 @@ export function printReport(report, screenshotsDir) {
109
114
  });
110
115
  }
111
116
 
117
+ const consoleIssues = report.results.filter(r =>
118
+ r.consoleLogs?.some(l => l.type === 'error' || l.type === 'warning')
119
+ );
120
+ if (consoleIssues.length > 0) {
121
+ console.log(`\n${C.yellow}${C.bold}BROWSER CONSOLE ISSUES:${C.reset}`);
122
+ consoleIssues.forEach(r => {
123
+ const logs = r.consoleLogs.filter(l => l.type === 'error' || l.type === 'warning');
124
+ console.log(` ${C.yellow}⚠${C.reset} ${r.name}:`);
125
+ logs.forEach(l => {
126
+ console.log(` ${C.dim}[${l.type}]${C.reset} ${l.text}`);
127
+ });
128
+ });
129
+ }
130
+
131
+ const networkIssues = report.results.filter(r => r.networkErrors?.length > 0);
132
+ if (networkIssues.length > 0) {
133
+ console.log(`\n${C.yellow}${C.bold}NETWORK ERRORS:${C.reset}`);
134
+ networkIssues.forEach(r => {
135
+ console.log(` ${C.yellow}⚠${C.reset} ${r.name}:`);
136
+ r.networkErrors.forEach(e => {
137
+ console.log(` ${C.dim}[${e.error || 'unknown'}]${C.reset} ${e.url}`);
138
+ });
139
+ });
140
+ }
141
+
112
142
  if (screenshotsDir) {
113
143
  console.log(`\n${C.dim}Report: ${path.join(screenshotsDir, 'report.json')}${C.reset}`);
114
144
  console.log(`${C.dim}Screenshots: ${screenshotsDir}${C.reset}\n`);
package/src/runner.js CHANGED
@@ -208,6 +208,14 @@ export async function runTestsParallel(tests, config, suiteHooks = {}) {
208
208
  const attempts = result.maxAttempts > 1 ? ` (${result.maxAttempts} attempts)` : '';
209
209
  log('❌', `${C.red}${test.name}${C.reset}: ${result.error}${attempts}`);
210
210
  }
211
+
212
+ const consoleIssues = result.consoleLogs?.filter(l => l.type === 'error' || l.type === 'warning').length || 0;
213
+ if (consoleIssues > 0) {
214
+ log('⚠️', `${C.yellow}${test.name}: ${consoleIssues} console ${consoleIssues === 1 ? 'issue' : 'issues'}${C.reset}`);
215
+ }
216
+ if (result.networkErrors?.length > 0) {
217
+ log('⚠️', `${C.yellow}${test.name}: ${result.networkErrors.length} network ${result.networkErrors.length === 1 ? 'error' : 'errors'}${C.reset}`);
218
+ }
211
219
  }
212
220
  };
213
221