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

@@ -126,30 +126,21 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
if (validator) {
return async params => {
return await this._wrapApiCall(async apiZone => {
const {
apiName,
frames,
csi,
callCookie,
stepId
} = apiZone.reported ? {
apiName: undefined,
csi: undefined,
callCookie: undefined,
frames: [],
stepId: undefined
} : apiZone;
apiZone.reported = true;
let currentStepId = stepId;
if (csi && apiName) {
const out = {};
csi.onApiCallBegin(apiName, params, frames, callCookie, out);
currentStepId = out.stepId;
}
return await this._connection.sendMessageToServer(this, prop, validator(params, '', {
const validatedParams = validator(params, '', {
tChannelImpl: tChannelImplToWire,
binary: this._connection.rawBuffers() ? 'buffer' : 'toBase64'
}), apiName, frames, currentStepId);
});
if (!apiZone.isInternal && !apiZone.reported) {
// Reporting/tracing/logging this api call for the first time.
apiZone.params = params;
apiZone.reported = true;
this._instrumentation.onApiCallBegin(apiZone);
logApiCall(this._logger, `=> ${apiZone.apiName} started`);
return await this._connection.sendMessageToServer(this, prop, validatedParams, apiZone.apiName, apiZone.frames, apiZone.stepId);
}
// Since this api call is either internal, or has already been reported/traced once,
// passing undefined apiName will avoid an extra unneeded tracing entry.
return await this._connection.sendMessageToServer(this, prop, validatedParams, undefined, [], undefined);
});
};
}
@@ -162,45 +153,35 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
}
async _wrapApiCall(func, isInternal) {
const logger = this._logger;
const apiZone = _zones.zones.zoneData('apiZone');
if (apiZone) return await func(apiZone);
const stackTrace = (0, _stackTrace.captureLibraryStackTrace)();
let apiName = stackTrace.apiName;
const frames = stackTrace.frames;
const existingApiZone = _zones.zones.zoneData('apiZone');
if (existingApiZone) return await func(existingApiZone);
if (isInternal === undefined) isInternal = this._isInternalType;
if (isInternal) apiName = undefined;
// Enclosing zone could have provided the apiName and wallTime.
const expectZone = _zones.zones.zoneData('expectZone');
const stepId = expectZone === null || expectZone === void 0 ? void 0 : expectZone.stepId;
if (!isInternal && expectZone) apiName = expectZone.title;
// If we are coming from the expectZone, there is no need to generate a new
// step for the API call, since it will be generated by the expect itself.
const csi = isInternal || expectZone ? undefined : this._instrumentation;
const callCookie = {};
const stackTrace = (0, _stackTrace.captureLibraryStackTrace)();
const apiZone = {
apiName: stackTrace.apiName,
frames: stackTrace.frames,
isInternal,
reported: false,
userData: undefined,
stepId: undefined
};
try {
logApiCall(logger, `=> ${apiName} started`, isInternal);
const apiZone = {
apiName,
frames,
isInternal,
reported: false,
csi,
callCookie,
stepId
};
const result = await _zones.zones.run('apiZone', apiZone, async () => await func(apiZone));
csi === null || csi === void 0 || csi.onApiCallEnd(callCookie);
logApiCall(logger, `<= ${apiName} succeeded`, isInternal);
if (!isInternal) {
logApiCall(logger, `<= ${apiZone.apiName} succeeded`);
this._instrumentation.onApiCallEnd(apiZone);
}
return result;
} catch (e) {
const innerError = (process.env.PWDEBUGIMPL || (0, _utils.isUnderTest)()) && e.stack ? '\n<inner error>\n' + e.stack : '';
if (apiName && !apiName.includes('<anonymous>')) e.message = apiName + ': ' + e.message;
if (apiZone.apiName && !apiZone.apiName.includes('<anonymous>')) e.message = apiZone.apiName + ': ' + e.message;
const stackFrames = '\n' + (0, _stackTrace.stringifyStackFrames)(stackTrace.frames).join('\n') + innerError;
if (stackFrames.trim()) e.stack = e.message + stackFrames;else e.stack = '';
csi === null || csi === void 0 || csi.onApiCallEnd(callCookie, e);
logApiCall(logger, `<= ${apiName} failed`, isInternal);
if (!isInternal) {
apiZone.error = e;
logApiCall(logger, `<= ${apiZone.apiName} failed`);
this._instrumentation.onApiCallEnd(apiZone);
}
throw e;
}
}
@@ -220,8 +201,7 @@ class ChannelOwner extends _eventEmitter.EventEmitter {
}
}
exports.ChannelOwner = ChannelOwner;
function logApiCall(logger, message, isNested) {
if (isNested) return;
function logApiCall(logger, message) {
if (logger && logger.isEnabled('api', 'info')) logger.log('api', 'info', message, [], {
color: 'cyan'
});

View File

@@ -20,6 +20,8 @@ exports.createInstrumentation = createInstrumentation;
* limitations under the License.
*/
// Instrumentation can mutate the data, for example change apiName or stepId.
function createInstrumentation() {
const listeners = [];
return new Proxy({}, {

View File

@@ -76,9 +76,9 @@ class Connection extends _events.EventEmitter {
this.toImpl = void 0;
this._tracingCount = 0;
this._instrumentation = void 0;
this._rootObject = new Root(this);
this._localUtils = localUtils;
this._instrumentation = instrumentation || (0, _clientInstrumentation.createInstrumentation)();
this._localUtils = localUtils;
this._rootObject = new Root(this);
}
markAsRemote() {
this._isRemote = true;
@@ -140,7 +140,7 @@ class Connection extends _events.EventEmitter {
}).catch(() => {});
// We need to exit zones before calling into the server, otherwise
// when we receive events from the server, we would be in an API zone.
_utils.zones.exitZones(() => this.onmessage({
_utils.zones.empty().run(() => this.onmessage({
...message,
metadata
}));

View File

@@ -50,6 +50,7 @@ class Request extends _channelOwner.ChannelOwner {
this._actualHeadersPromise = void 0;
this._timing = void 0;
this._fallbackOverrides = {};
this.markAsInternalType();
this._redirectedFrom = Request.fromNullable(initializer.redirectedFrom);
if (this._redirectedFrom) this._redirectedFrom._redirectedTo = this;
this._provisionalHeaders = new RawHeaders(initializer.headers);
@@ -510,6 +511,7 @@ class Response extends _channelOwner.ChannelOwner {
this._actualHeadersPromise = void 0;
this._request = void 0;
this._finishedPromise = new _manualPromise.ManualPromise();
this.markAsInternalType();
this._provisionalHeaders = new RawHeaders(initializer.headers);
this._request = Request.from(this._initializer.request);
Object.assign(this._request._timing, this._initializer.timing);
@@ -659,7 +661,7 @@ class RouteHandler {
this._times = times;
this.url = url;
this.handler = handler;
this._svedZone = _utils.zones.currentZone();
this._svedZone = _utils.zones.current().without('apiZone');
}
static prepareInterceptionPatterns(handlers) {
const patterns = [];

View File

@@ -35,7 +35,7 @@ class Waiter {
this._savedZone = void 0;
this._waitId = (0, _utils.createGuid)();
this._channelOwner = channelOwner;
this._savedZone = _utils.zones.currentZone();
this._savedZone = _utils.zones.current().without('apiZone');
this._channelOwner._channel.waitForEventInfo({
info: {
waitId: this._waitId,