Skip to content

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

feat(debug): add note about DEBUG=pw:api to errors (#2496)

Dmitry Gozmanbb4e959d2dc5
diff --git a/src/progress.ts b/src/progress.ts
index fae37a324b..da7c444042 100644
--- a/src/progress.ts
+++ b/src/progress.ts
@@ -104,7 +104,7 @@ export class ProgressController {
return result;
} catch (e) {
this._aborted();
- rewriteErrorMessage(e, e.message + formatLogRecording(this._logRecording, this._apiName));
+ rewriteErrorMessage(e, e.message + formatLogRecording(this._logRecording, this._apiName) + kLoggingNote);
clearTimeout(timer);
this._state = 'aborted';
this._logRecording = [];
@@ -126,6 +126,8 @@ async function runCleanup(cleanup: () => any) {
}
}
+const kLoggingNote = `\nNote: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.`;
+
function formatLogRecording(log: string[], name: string): string {
if (!log.length)
return '';