mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 23:15:42 -04:00
build(deps): bump playwright from 1.49.1 to 1.50.1
This commit is contained in:
6
node_modules/playwright/lib/worker/fixtureRunner.js
generated
vendored
6
node_modules/playwright/lib/worker/fixtureRunner.js
generated
vendored
@@ -62,13 +62,14 @@ class Fixture {
|
||||
};
|
||||
}
|
||||
async setup(testInfo, runnable) {
|
||||
var _this$registration$cu;
|
||||
this.runner.instanceForId.set(this.registration.id, this);
|
||||
if (typeof this.registration.fn !== 'function') {
|
||||
this.value = this.registration.fn;
|
||||
return;
|
||||
}
|
||||
await testInfo._runAsStage({
|
||||
title: `fixture: ${this.registration.name}`,
|
||||
title: `fixture: ${(_this$registration$cu = this.registration.customTitle) !== null && _this$registration$cu !== void 0 ? _this$registration$cu : this.registration.name}`,
|
||||
runnable: {
|
||||
...runnable,
|
||||
fixture: this._setupDescription
|
||||
@@ -135,8 +136,9 @@ class Fixture {
|
||||
// Do not even start the teardown for a fixture that does not have any
|
||||
// time remaining in the time slot. This avoids cascading timeouts.
|
||||
if (!testInfo._timeoutManager.isTimeExhaustedFor(fixtureRunnable)) {
|
||||
var _this$registration$cu2;
|
||||
await testInfo._runAsStage({
|
||||
title: `fixture: ${this.registration.name}`,
|
||||
title: `fixture: ${(_this$registration$cu2 = this.registration.customTitle) !== null && _this$registration$cu2 !== void 0 ? _this$registration$cu2 : this.registration.name}`,
|
||||
runnable: fixtureRunnable,
|
||||
stepInfo: this._stepInfo
|
||||
}, async () => {
|
||||
|
||||
59
node_modules/playwright/lib/worker/testInfo.js
generated
vendored
59
node_modules/playwright/lib/worker/testInfo.js
generated
vendored
@@ -74,6 +74,7 @@ class TestInfoImpl {
|
||||
this._projectInternal = void 0;
|
||||
this._configInternal = void 0;
|
||||
this._steps = [];
|
||||
this._stepMap = new Map();
|
||||
this._onDidFinishTestFunction = void 0;
|
||||
this._hasNonRetriableError = false;
|
||||
this._hasUnhandledError = false;
|
||||
@@ -144,7 +145,10 @@ class TestInfoImpl {
|
||||
})();
|
||||
this._attachmentsPush = this.attachments.push.bind(this.attachments);
|
||||
this.attachments.push = (...attachments) => {
|
||||
for (const a of attachments) this._attach(a.name, a);
|
||||
for (const a of attachments) {
|
||||
var _this$_parentStep;
|
||||
this._attach(a, (_this$_parentStep = this._parentStep()) === null || _this$_parentStep === void 0 ? void 0 : _this$_parentStep.stepId);
|
||||
}
|
||||
return this.attachments.length;
|
||||
};
|
||||
this._tracing = new _testTracing.TestTracing(this, workerParams.artifactsDir);
|
||||
@@ -176,6 +180,10 @@ class TestInfoImpl {
|
||||
if (steps[i].isStage && !steps[i].endWallTime) return steps[i];
|
||||
}
|
||||
}
|
||||
_parentStep() {
|
||||
var _zones$zoneData;
|
||||
return (_zones$zoneData = _utils.zones.zoneData('stepZone')) !== null && _zones$zoneData !== void 0 ? _zones$zoneData : this._findLastStageStep(this._steps); // If no parent step on stack, assume the current stage as parent.
|
||||
}
|
||||
_addStep(data, parentStep) {
|
||||
var _parentStep, _parentStep2;
|
||||
const stepId = `${data.category}@${++this._lastStepId}`;
|
||||
@@ -183,11 +191,7 @@ class TestInfoImpl {
|
||||
// Predefined stages form a fixed hierarchy - use the current one as parent.
|
||||
parentStep = this._findLastStageStep(this._steps);
|
||||
} else {
|
||||
if (!parentStep) parentStep = _utils.zones.zoneData('stepZone');
|
||||
if (!parentStep) {
|
||||
// If no parent step on stack, assume the current stage as parent.
|
||||
parentStep = this._findLastStageStep(this._steps);
|
||||
}
|
||||
if (!parentStep) parentStep = this._parentStep();
|
||||
}
|
||||
const filteredStack = (0, _util.filteredStackTrace)((0, _utils.captureRawStack)());
|
||||
data.boxedStack = (_parentStep = parentStep) === null || _parentStep === void 0 ? void 0 : _parentStep.boxedStack;
|
||||
@@ -196,10 +200,12 @@ class TestInfoImpl {
|
||||
data.location = data.location || data.boxedStack[0];
|
||||
}
|
||||
data.location = data.location || filteredStack[0];
|
||||
const attachmentIndices = [];
|
||||
const step = {
|
||||
stepId,
|
||||
...data,
|
||||
steps: [],
|
||||
attachmentIndices,
|
||||
complete: result => {
|
||||
if (step.endWallTime) return;
|
||||
step.endWallTime = Date.now();
|
||||
@@ -235,11 +241,13 @@ class TestInfoImpl {
|
||||
message: step.error.message || '',
|
||||
stack: step.error.stack
|
||||
} : undefined;
|
||||
this._tracing.appendAfterActionForStep(stepId, errorForTrace, result.attachments);
|
||||
const attachments = attachmentIndices.map(i => this.attachments[i]);
|
||||
this._tracing.appendAfterActionForStep(stepId, errorForTrace, attachments);
|
||||
}
|
||||
};
|
||||
const parentStepList = parentStep ? parentStep.steps : this._steps;
|
||||
parentStepList.push(step);
|
||||
this._stepMap.set(stepId, step);
|
||||
const payload = {
|
||||
testId: this.testId,
|
||||
stepId,
|
||||
@@ -250,7 +258,7 @@ class TestInfoImpl {
|
||||
location: data.location
|
||||
};
|
||||
this._onStepBegin(payload);
|
||||
this._tracing.appendBeforeActionForStep(stepId, (_parentStep2 = parentStep) === null || _parentStep2 === void 0 ? void 0 : _parentStep2.stepId, data.apiName || data.title, data.params, data.location ? [data.location] : []);
|
||||
this._tracing.appendBeforeActionForStep(stepId, (_parentStep2 = parentStep) === null || _parentStep2 === void 0 ? void 0 : _parentStep2.stepId, data.category, data.apiName || data.title, data.params, data.location ? [data.location] : []);
|
||||
return step;
|
||||
}
|
||||
_interrupt() {
|
||||
@@ -330,24 +338,32 @@ class TestInfoImpl {
|
||||
// ------------ TestInfo methods ------------
|
||||
|
||||
async attach(name, options = {}) {
|
||||
this._attach(name, await (0, _util.normalizeAndSaveAttachment)(this.outputPath(), name, options));
|
||||
}
|
||||
_attach(name, attachment) {
|
||||
var _attachment$body;
|
||||
const step = this._addStep({
|
||||
title: `attach "${name}"`,
|
||||
category: 'attach'
|
||||
});
|
||||
this._attachmentsPush(attachment);
|
||||
this._attach(await (0, _util.normalizeAndSaveAttachment)(this.outputPath(), name, options), step.stepId);
|
||||
step.complete({});
|
||||
}
|
||||
_attach(attachment, stepId) {
|
||||
var _attachment$body;
|
||||
const index = this._attachmentsPush(attachment) - 1;
|
||||
if (stepId) {
|
||||
this._stepMap.get(stepId).attachmentIndices.push(index);
|
||||
} else {
|
||||
var _this$_findLastStageS;
|
||||
// trace viewer has no means of representing attachments outside of a step, so we create an artificial action
|
||||
const callId = `attach@${++this._lastStepId}`;
|
||||
this._tracing.appendBeforeActionForStep(callId, (_this$_findLastStageS = this._findLastStageStep(this._steps)) === null || _this$_findLastStageS === void 0 ? void 0 : _this$_findLastStageS.stepId, 'attach', `attach "${attachment.name}"`, undefined, []);
|
||||
this._tracing.appendAfterActionForStep(callId, undefined, [attachment]);
|
||||
}
|
||||
this._onAttach({
|
||||
testId: this.testId,
|
||||
name: attachment.name,
|
||||
contentType: attachment.contentType,
|
||||
path: attachment.path,
|
||||
body: (_attachment$body = attachment.body) === null || _attachment$body === void 0 ? void 0 : _attachment$body.toString('base64')
|
||||
});
|
||||
step.complete({
|
||||
attachments: [attachment]
|
||||
body: (_attachment$body = attachment.body) === null || _attachment$body === void 0 ? void 0 : _attachment$body.toString('base64'),
|
||||
stepId
|
||||
});
|
||||
}
|
||||
outputPath(...pathSegments) {
|
||||
@@ -367,15 +383,20 @@ class TestInfoImpl {
|
||||
const fullTitleWithoutSpec = this.titlePath.slice(1).join(' ');
|
||||
return (0, _utils.sanitizeForFilePath)((0, _util.trimLongString)(fullTitleWithoutSpec));
|
||||
}
|
||||
snapshotPath(...pathSegments) {
|
||||
_resolveSnapshotPath(template, defaultTemplate, pathSegments) {
|
||||
const subPath = _path.default.join(...pathSegments);
|
||||
const parsedSubPath = _path.default.parse(subPath);
|
||||
const relativeTestFilePath = _path.default.relative(this.project.testDir, this._requireFile);
|
||||
const parsedRelativeTestFilePath = _path.default.parse(relativeTestFilePath);
|
||||
const projectNamePathSegment = (0, _utils.sanitizeForFilePath)(this.project.name);
|
||||
const snapshotPath = (this._projectInternal.snapshotPathTemplate || '').replace(/\{(.)?testDir\}/g, '$1' + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, '$1' + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? '$1' + this.snapshotSuffix : '').replace(/\{(.)?testFileDir\}/g, '$1' + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, '$1' + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? '$1' + projectNamePathSegment : '').replace(/\{(.)?testName\}/g, '$1' + this._fsSanitizedTestName()).replace(/\{(.)?testFileName\}/g, '$1' + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, '$1' + relativeTestFilePath).replace(/\{(.)?arg\}/g, '$1' + _path.default.join(parsedSubPath.dir, parsedSubPath.name)).replace(/\{(.)?ext\}/g, parsedSubPath.ext ? '$1' + parsedSubPath.ext : '');
|
||||
const actualTemplate = template || this._projectInternal.snapshotPathTemplate || defaultTemplate;
|
||||
const snapshotPath = actualTemplate.replace(/\{(.)?testDir\}/g, '$1' + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, '$1' + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? '$1' + this.snapshotSuffix : '').replace(/\{(.)?testFileDir\}/g, '$1' + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, '$1' + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? '$1' + projectNamePathSegment : '').replace(/\{(.)?testName\}/g, '$1' + this._fsSanitizedTestName()).replace(/\{(.)?testFileName\}/g, '$1' + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, '$1' + relativeTestFilePath).replace(/\{(.)?arg\}/g, '$1' + _path.default.join(parsedSubPath.dir, parsedSubPath.name)).replace(/\{(.)?ext\}/g, parsedSubPath.ext ? '$1' + parsedSubPath.ext : '');
|
||||
return _path.default.normalize(_path.default.resolve(this._configInternal.configDir, snapshotPath));
|
||||
}
|
||||
snapshotPath(...pathSegments) {
|
||||
const legacyTemplate = '{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}';
|
||||
return this._resolveSnapshotPath(undefined, legacyTemplate, pathSegments);
|
||||
}
|
||||
skip(...args) {
|
||||
this._modifier('skip', args);
|
||||
}
|
||||
|
||||
4
node_modules/playwright/lib/worker/testTracing.js
generated
vendored
4
node_modules/playwright/lib/worker/testTracing.js
generated
vendored
@@ -212,14 +212,14 @@ class TestTracing {
|
||||
base64: typeof chunk === 'string' ? undefined : chunk.toString('base64')
|
||||
});
|
||||
}
|
||||
appendBeforeActionForStep(callId, parentId, apiName, params, stack) {
|
||||
appendBeforeActionForStep(callId, parentId, category, apiName, params, stack) {
|
||||
this._appendTraceEvent({
|
||||
type: 'before',
|
||||
callId,
|
||||
parentId,
|
||||
startTime: (0, _utils.monotonicTime)(),
|
||||
class: 'Test',
|
||||
method: 'step',
|
||||
method: category,
|
||||
apiName,
|
||||
params: Object.fromEntries(Object.entries(params || {}).map(([name, value]) => [name, generatePreview(value)])),
|
||||
stack
|
||||
|
||||
6
node_modules/playwright/lib/worker/workerMain.js
generated
vendored
6
node_modules/playwright/lib/worker/workerMain.js
generated
vendored
@@ -71,17 +71,19 @@ class WorkerMain extends _process.ProcessRunner {
|
||||
this._runFinished.resolve();
|
||||
process.on('unhandledRejection', reason => this.unhandledError(reason));
|
||||
process.on('uncaughtException', error => this.unhandledError(error));
|
||||
process.stdout.write = chunk => {
|
||||
process.stdout.write = (chunk, cb) => {
|
||||
var _this$_currentTest;
|
||||
this.dispatchEvent('stdOut', (0, _ipc.stdioChunkToParams)(chunk));
|
||||
(_this$_currentTest = this._currentTest) === null || _this$_currentTest === void 0 || _this$_currentTest._tracing.appendStdioToTrace('stdout', chunk);
|
||||
if (typeof cb === 'function') process.nextTick(cb);
|
||||
return true;
|
||||
};
|
||||
if (!process.env.PW_RUNNER_DEBUG) {
|
||||
process.stderr.write = chunk => {
|
||||
process.stderr.write = (chunk, cb) => {
|
||||
var _this$_currentTest2;
|
||||
this.dispatchEvent('stdErr', (0, _ipc.stdioChunkToParams)(chunk));
|
||||
(_this$_currentTest2 = this._currentTest) === null || _this$_currentTest2 === void 0 || _this$_currentTest2._tracing.appendStdioToTrace('stderr', chunk);
|
||||
if (typeof cb === 'function') process.nextTick(cb);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user