Skip to content

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

chore: write blob report to the config dir by default (#22697)

Yury Semikhatsky16f664e22c4e
diff --git a/packages/playwright-test/src/reporters/blob.ts b/packages/playwright-test/src/reporters/blob.ts
index 500e7cf050..c911e96c6b 100644
--- a/packages/playwright-test/src/reporters/blob.ts
+++ b/packages/playwright-test/src/reporters/blob.ts
@@ -23,7 +23,6 @@ import { yazl } from 'playwright-core/lib/zipBundle';
import { Readable } from 'stream';
import type { FullConfig, FullResult, TestResult } from '../../types/testReporter';
import type { Suite } from '../common/test';
-import { defaultReportFolder } from './html';
import { TeleReporterEmitter } from './teleEmitter';
@@ -83,7 +82,7 @@ export class BlobReporter extends TeleReporterEmitter {
}
private _computeOutputFileName(config: FullConfig) {
- const outputDir = this._resolveOutputDir();
+ const outputDir = path.resolve(this._options.configDir, this._options.outputDir || '');
let shardSuffix = '';
if (config.shard) {
const paddedNumber = `${config.shard.current}`.padStart(`${config.shard.total}`.length, '0');
@@ -91,11 +90,4 @@ export class BlobReporter extends TeleReporterEmitter {
}
return path.join(outputDir, `report${shardSuffix}.zip`);
}
-
- private _resolveOutputDir(): string {
- const { outputDir } = this._options;
- if (outputDir)
- return path.resolve(this._options.configDir, outputDir);
- return defaultReportFolder(this._options.configDir);
- }
}
diff --git a/packages/playwright-test/src/reporters/html.ts b/packages/playwright-test/src/reporters/html.ts
index 0e8c4c6655..b514937764 100644
--- a/packages/playwright-test/src/reporters/html.ts
+++ b/packages/playwright-test/src/reporters/html.ts
@@ -142,7 +142,7 @@ function reportFolderFromEnv(): string | undefined {
return undefined;
}
-export function defaultReportFolder(searchForPackageJson: string): string {
+function defaultReportFolder(searchForPackageJson: string): string {
let basePath = getPackageJsonPath(searchForPackageJson);
if (basePath)
basePath = path.dirname(basePath);