fix(html-reporter): Include specified host and port in the logged instructions to launch the HTML report (#28144)

Signed-off-by: Daniel <3473356+D4N14L@users.noreply.github.com>
This commit is contained in:
Daniel 2023-11-15 12:25:03 -08:00 committed by GitHub
parent 611badcf74
commit 1c8ceb0a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,10 +134,12 @@ class HtmlReporter extends EmptyReporter {
} else if (!FullConfigInternal.from(this.config)?.cliListOnly) {
const packageManagerCommand = getPackageManagerExecCommand();
const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? '' : ' ' + path.relative(process.cwd(), this._outputFolder);
const hostArg = this._options.host ? ` --host ${this._options.host}` : '';
const portArg = this._options.port ? ` --port ${this._options.port}` : '';
console.log('');
console.log('To open last HTML report run:');
console.log(colors.cyan(`
${packageManagerCommand} playwright show-report${relativeReportPath}
${packageManagerCommand} playwright show-report${relativeReportPath}${hostArg}${portArg}
`));
}
}