Skip to content

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

chore(bidi): create parent dir for report.csv (#34294)

Yury Semikhatsky423005a7ab0c
diff --git a/tests/bidi/csvReporter.ts b/tests/bidi/csvReporter.ts
index f227550ef3..821f6e6f48 100644
--- a/tests/bidi/csvReporter.ts
+++ b/tests/bidi/csvReporter.ts
@@ -66,7 +66,10 @@ class CsvReporter implements Reporter {
}
const csv = rows.map(r => r.join(',')).join('\n');
const reportFile = path.resolve(this._options.configDir, this._options.outputFile || 'test-results.csv');
- this._pendingWrite = fs.promises.writeFile(reportFile, csv);
+ this._pendingWrite = (async () => {
+ await fs.mkdirSync(path.dirname(reportFile), { recursive: true });
+ await fs.promises.writeFile(reportFile, csv);
+ })();
}
async onExit() {