1
1
mirror of https://github.com/microsoft/playwright.git synced 2024-12-15 06:02:57 +03:00

chore: print global errors when running html report ()

This commit is contained in:
Pavel Feldman 2021-10-20 10:57:21 -08:00 committed by GitHub
parent b3b5497578
commit 68c9fce507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,11 +18,12 @@ import colors from 'colors/safe';
import fs from 'fs'; import fs from 'fs';
import open from 'open'; import open from 'open';
import path from 'path'; 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 { HttpServer } from 'playwright-core/src/utils/httpServer';
import { calculateSha1, removeFolders } from 'playwright-core/src/utils/utils'; import { calculateSha1, removeFolders } from 'playwright-core/src/utils/utils';
import RawReporter, { JsonReport, JsonSuite, JsonTestCase, JsonTestResult, JsonTestStep, JsonAttachment } from './raw'; import RawReporter, { JsonReport, JsonSuite, JsonTestCase, JsonTestResult, JsonTestStep, JsonAttachment } from './raw';
import assert from 'assert'; import assert from 'assert';
import { formatError } from './base';
export type Stats = { export type Stats = {
total: number; total: number;
@ -140,6 +141,10 @@ class HtmlReporter {
} }
} }
} }
onError(error: TestError) {
console.log(formatError(error, colors.enabled));
}
} }
export function htmlReportFolder(outputFolder?: string): string { export function htmlReportFolder(outputFolder?: string): string {