Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: print global errors when running html report (#9657)

Pavel Feldman68c9fce50772
diff --git a/packages/playwright-test/src/reporters/html.ts b/packages/playwright-test/src/reporters/html.ts
index 7337fc89ca..01f276f1d8 100644
--- a/packages/playwright-test/src/reporters/html.ts
+++ b/packages/playwright-test/src/reporters/html.ts
@@ -18,11 +18,12 @@ import colors from 'colors/safe';
import fs from 'fs';
import open from 'open';
import path from 'path';
-import { FullConfig, Suite } from '../../types/testReporter';
+import { FullConfig, Suite, TestError } from '../../types/testReporter';
import { HttpServer } from 'playwright-core/src/utils/httpServer';
import { calculateSha1, removeFolders } from 'playwright-core/src/utils/utils';
import RawReporter, { JsonReport, JsonSuite, JsonTestCase, JsonTestResult, JsonTestStep, JsonAttachment } from './raw';
import assert from 'assert';
+import { formatError } from './base';
export type Stats = {
total: number;
@@ -140,6 +141,10 @@ class HtmlReporter {
}
}
}
+
+ onError(error: TestError) {
+ console.log(formatError(error, colors.enabled));
+ }
}
export function htmlReportFolder(outputFolder?: string): string {