Skip to content

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

Revert "chore: support narrow terminal windows for messages (#18714)"

Pavel Feldman4bbfcef79237
diff --git a/packages/playwright-core/src/utils/index.ts b/packages/playwright-core/src/utils/index.ts
index f388abbdca..a84512a92d 100644
--- a/packages/playwright-core/src/utils/index.ts
+++ b/packages/playwright-core/src/utils/index.ts
@@ -191,10 +191,12 @@ export function constructURLBasedOnBaseURL(baseURL: string | undefined, givenURL
export function wrapInASCIIBox(text: string, padding = 0): string {
const lines = text.split('\n');
- const maxLineLength = Math.max(...lines.map(line => line.length));
- const separatorLength = process.stdout.columns || maxLineLength;
- const separator = '═'.repeat(separatorLength);
- return [separator, ...lines, separator, ''].join('\n');
+ const maxLength = Math.max(...lines.map(line => line.length));
+ return [
+ '╔' + '═'.repeat(maxLength + padding * 2) + '╗',
+ ...lines.map(line => '║' + ' '.repeat(padding) + line + ' '.repeat(maxLength - line.length + padding) + '║'),
+ '╚' + '═'.repeat(maxLength + padding * 2) + '╝',
+ ].join('\n');
}
export function isFilePayload(value: any): boolean {