build(deps): bump playwright from 1.49.1 to 1.50.1

This commit is contained in:
2025-02-21 17:22:03 -07:00
parent 79c9869e65
commit dc6d9c68a9
174 changed files with 3064 additions and 1955 deletions

View File

@@ -27,7 +27,7 @@ var _utils = require("playwright-core/lib/utils");
const DOES_NOT_SUPPORT_UTF8_IN_TERMINAL = process.platform === 'win32' && process.env.TERM_PROGRAM !== 'vscode' && !process.env.WT_SESSION;
const POSITIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? 'ok' : '✓';
const NEGATIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? 'x' : '✘';
class ListReporter extends _base.BaseReporter {
class ListReporter extends _base.TerminalReporter {
constructor(options = {}) {
super();
this._lastRow = 0;
@@ -51,11 +51,11 @@ class ListReporter extends _base.BaseReporter {
onTestBegin(test, result) {
const index = String(this._resultIndex.size + 1);
this._resultIndex.set(result, index);
if (!_base.isTTY) return;
if (!this.screen.isTTY) return;
this._maybeWriteNewLine();
this._testRows.set(test, this._lastRow);
const prefix = this._testPrefix(index, '');
const line = _base.colors.dim((0, _base.formatTestTitle)(this.config, test)) + this._retrySuffix(result);
const line = this.screen.colors.dim(this.formatTestTitle(test)) + this._retrySuffix(result);
this._appendLine(line, prefix);
}
onStdOut(chunk, test, result) {
@@ -77,41 +77,43 @@ class ListReporter extends _base.BaseReporter {
onStepBegin(test, result, step) {
if (step.category !== 'test.step') return;
const testIndex = this._resultIndex.get(result) || '';
if (!_base.isTTY) return;
if (!this.screen.isTTY) return;
if (this._printSteps) {
this._maybeWriteNewLine();
this._stepRows.set(step, this._lastRow);
const prefix = this._testPrefix(this.getStepIndex(testIndex, result, step), '');
const line = test.title + _base.colors.dim((0, _base.stepSuffix)(step));
const line = test.title + this.screen.colors.dim((0, _base.stepSuffix)(step));
this._appendLine(line, prefix);
} else {
this._updateLine(this._testRows.get(test), _base.colors.dim((0, _base.formatTestTitle)(this.config, test, step)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));
this._updateLine(this._testRows.get(test), this.screen.colors.dim(this.formatTestTitle(test, step)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));
}
}
onStepEnd(test, result, step) {
if (step.category !== 'test.step') return;
const testIndex = this._resultIndex.get(result) || '';
if (!this._printSteps) {
if (_base.isTTY) this._updateLine(this._testRows.get(test), _base.colors.dim((0, _base.formatTestTitle)(this.config, test, step.parent)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));
if (this.screen.isTTY) this._updateLine(this._testRows.get(test), this.screen.colors.dim(this.formatTestTitle(test, step.parent)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));
return;
}
const index = this.getStepIndex(testIndex, result, step);
const title = _base.isTTY ? test.title + _base.colors.dim((0, _base.stepSuffix)(step)) : (0, _base.formatTestTitle)(this.config, test, step);
const title = this.screen.isTTY ? test.title + this.screen.colors.dim((0, _base.stepSuffix)(step)) : this.formatTestTitle(test, step);
const prefix = this._testPrefix(index, '');
let text = '';
if (step.error) text = _base.colors.red(title);else text = title;
text += _base.colors.dim(` (${(0, _utilsBundle.ms)(step.duration)})`);
if (step.error) text = this.screen.colors.red(title);else text = title;
text += this.screen.colors.dim(` (${(0, _utilsBundle.ms)(step.duration)})`);
this._updateOrAppendLine(this._stepRows.get(step), text, prefix);
}
_maybeWriteNewLine() {
if (this._needNewLine) {
this._needNewLine = false;
process.stdout.write('\n');
++this._lastRow;
this._lastColumn = 0;
}
}
_updateLineCountAndNewLineFlagForOutput(text) {
this._needNewLine = text[text.length - 1] !== '\n';
if (!_base.ttyWidth) return;
if (!this.screen.ttyWidth) return;
for (const ch of text) {
if (ch === '\n') {
this._lastColumn = 0;
@@ -119,7 +121,7 @@ class ListReporter extends _base.BaseReporter {
continue;
}
++this._lastColumn;
if (this._lastColumn > _base.ttyWidth) {
if (this._lastColumn > this.screen.ttyWidth) {
this._lastColumn = 0;
++this._lastRow;
}
@@ -133,7 +135,7 @@ class ListReporter extends _base.BaseReporter {
}
onTestEnd(test, result) {
super.onTestEnd(test, result);
const title = (0, _base.formatTestTitle)(this.config, test);
const title = this.formatTestTitle(test);
let prefix = '';
let text = '';
@@ -145,24 +147,24 @@ class ListReporter extends _base.BaseReporter {
this._resultIndex.set(result, index);
}
if (result.status === 'skipped') {
prefix = this._testPrefix(index, _base.colors.green('-'));
prefix = this._testPrefix(index, this.screen.colors.green('-'));
// Do not show duration for skipped.
text = _base.colors.cyan(title) + this._retrySuffix(result);
text = this.screen.colors.cyan(title) + this._retrySuffix(result);
} else {
const statusMark = result.status === 'passed' ? POSITIVE_STATUS_MARK : NEGATIVE_STATUS_MARK;
if (result.status === test.expectedStatus) {
prefix = this._testPrefix(index, _base.colors.green(statusMark));
prefix = this._testPrefix(index, this.screen.colors.green(statusMark));
text = title;
} else {
prefix = this._testPrefix(index, _base.colors.red(statusMark));
text = _base.colors.red(title);
prefix = this._testPrefix(index, this.screen.colors.red(statusMark));
text = this.screen.colors.red(title);
}
text += this._retrySuffix(result) + _base.colors.dim(` (${(0, _utilsBundle.ms)(result.duration)})`);
text += this._retrySuffix(result) + this.screen.colors.dim(` (${(0, _utilsBundle.ms)(result.duration)})`);
}
this._updateOrAppendLine(this._testRows.get(test), text, prefix);
}
_updateOrAppendLine(row, text, prefix) {
if (_base.isTTY) {
if (this.screen.isTTY) {
this._updateLine(row, text, prefix);
} else {
this._maybeWriteNewLine();
@@ -178,6 +180,7 @@ class ListReporter extends _base.BaseReporter {
process.stdout.write('\n');
}
++this._lastRow;
this._lastColumn = 0;
}
_updateLine(row, text, prefix) {
const line = prefix + this.fitToScreen(text, prefix);
@@ -194,15 +197,15 @@ class ListReporter extends _base.BaseReporter {
}
_testPrefix(index, statusMark) {
const statusMarkLength = (0, _base.stripAnsiEscapes)(statusMark).length;
return ' ' + statusMark + ' '.repeat(3 - statusMarkLength) + _base.colors.dim(index + ' ');
return ' ' + statusMark + ' '.repeat(3 - statusMarkLength) + this.screen.colors.dim(index + ' ');
}
_retrySuffix(result) {
return result.retry ? _base.colors.yellow(` (retry #${result.retry})`) : '';
return result.retry ? this.screen.colors.yellow(` (retry #${result.retry})`) : '';
}
onError(error) {
super.onError(error);
this._maybeWriteNewLine();
const message = (0, _base.formatError)(error, _base.colors.enabled).message + '\n';
const message = this.formatError(error).message + '\n';
this._updateLineCountAndNewLineFlagForOutput(message);
process.stdout.write(message);
}