fix(html reporter): do not print epilogue in list mode (#23822)

References #23817.
This commit is contained in:
Dmitry Gozman 2023-06-21 17:53:52 -07:00 committed by GitHub
parent 605dfde2be
commit b154ff1190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -53,7 +53,8 @@ export class FullConfigInternal {
testIdMatcher?: Matcher; testIdMatcher?: Matcher;
defineConfigWasUsed = false; defineConfigWasUsed = false;
static from(config: FullConfig): FullConfigInternal { // TODO: when merging reports, there could be no internal config. This is very unfortunate.
static from(config: FullConfig): FullConfigInternal | undefined {
return (config as any)[configInternalSymbol]; return (config as any)[configInternalSymbol];
} }

View File

@ -30,6 +30,7 @@ import type { ZipFile } from 'playwright-core/lib/zipBundle';
import { yazl } from 'playwright-core/lib/zipBundle'; import { yazl } from 'playwright-core/lib/zipBundle';
import { mime } from 'playwright-core/lib/utilsBundle'; import { mime } from 'playwright-core/lib/utilsBundle';
import type { HTMLReport, Stats, TestAttachment, TestCase, TestCaseSummary, TestFile, TestFileSummary, TestResult, TestStep } from '@html-reporter/types'; import type { HTMLReport, Stats, TestAttachment, TestCase, TestCaseSummary, TestFile, TestFileSummary, TestResult, TestStep } from '@html-reporter/types';
import { FullConfigInternal } from '../common/config';
type TestEntry = { type TestEntry = {
testCase: TestCase; testCase: TestCase;
@ -119,7 +120,7 @@ class HtmlReporter implements Reporter {
const shouldOpen = this._open === 'always' || (!ok && this._open === 'on-failure'); const shouldOpen = this._open === 'always' || (!ok && this._open === 'on-failure');
if (shouldOpen) { if (shouldOpen) {
await showHTMLReport(this._outputFolder, this._options.host, this._options.port, singleTestId); await showHTMLReport(this._outputFolder, this._options.host, this._options.port, singleTestId);
} else { } else if (!FullConfigInternal.from(this.config)?.cliListOnly) {
const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? '' : ' ' + path.relative(process.cwd(), this._outputFolder); const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? '' : ' ' + path.relative(process.cwd(), this._outputFolder);
console.log(''); console.log('');
console.log('To open last HTML report run:'); console.log('To open last HTML report run:');

View File

@ -129,8 +129,7 @@ export class TeleReporterEmitter implements Reporter {
rootDir: config.rootDir, rootDir: config.rootDir,
version: config.version, version: config.version,
workers: config.workers, workers: config.workers,
listOnly: !!FullConfigInternal.from(config)?.cliListOnly,
listOnly: FullConfigInternal.from(config)?.cliListOnly,
}; };
} }