chore: allow setting reporter via env (#11848)
This commit is contained in:
parent
d237ad76c1
commit
72424dc904
|
|
@ -125,7 +125,7 @@ class HtmlReporter implements Reporter {
|
|||
constructor(options: { outputFolder?: string, open?: 'always' | 'never' | 'on-failure' } = {}) {
|
||||
// TODO: resolve relative to config.
|
||||
this._outputFolder = options.outputFolder;
|
||||
this._open = options.open || 'on-failure';
|
||||
this._open = process.env.PW_TEST_HTML_REPORT_OPEN as any || options.open || 'on-failure';
|
||||
}
|
||||
|
||||
printsToStdio() {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,11 @@ export class Runner {
|
|||
reporters.push(new reporterConstructor(arg));
|
||||
}
|
||||
}
|
||||
if (process.env.PW_TEST_REPORTER) {
|
||||
const reporterConstructor = await this._loader.loadReporter(process.env.PW_TEST_REPORTER);
|
||||
reporters.push(new reporterConstructor());
|
||||
}
|
||||
|
||||
const someReporterPrintsToStdio = reporters.some(r => {
|
||||
const prints = r.printsToStdio ? r.printsToStdio() : true;
|
||||
return prints;
|
||||
|
|
|
|||
Loading…
Reference in a new issue