playwright
Advanced tools
Comparing version 1.50.0-alpha-2025-01-16 to 1.50.0-alpha-2025-01-17
@@ -444,8 +444,8 @@ "use strict"; | ||
if (!testInfo || data.apiName.includes('setTestIdAttribute') || data.apiName === 'tracing.groupEnd') return; | ||
const expectZone = _utils.zones.zoneData('expectZone'); | ||
if (expectZone) { | ||
const zone = _utils.zones.zoneData('stepZone'); | ||
if (zone && zone.category === 'expect') { | ||
// Display the internal locator._expect call under the name of the enclosing expect call, | ||
// and connect it to the existing expect step. | ||
data.apiName = expectZone.title; | ||
data.stepId = expectZone.stepId; | ||
data.apiName = zone.title; | ||
data.stepId = zone.stepId; | ||
return; | ||
@@ -452,0 +452,0 @@ } |
@@ -238,5 +238,6 @@ "use strict"; | ||
// Enclose toPass in a step to maintain async stacks, toPass matcher is always async. | ||
// toPass and poll matchers can contain other steps, expects and API calls, | ||
// so they behave like a retriable step. | ||
const stepInfo = { | ||
category: 'expect', | ||
category: matcherName === 'toPass' || this._info.poll ? 'step' : 'expect', | ||
title: (0, _util.trimLongString)(title, 1024), | ||
@@ -268,8 +269,3 @@ params: args[0] ? { | ||
const callback = () => matcher.call(target, ...args); | ||
// toPass and poll matchers can contain other steps, expects and API calls, | ||
// so they behave like a retriable step. | ||
const result = matcherName === 'toPass' || this._info.poll ? _utils.zones.run('stepZone', step, callback) : _utils.zones.run('expectZone', { | ||
title, | ||
stepId: step.stepId | ||
}, callback); | ||
const result = _utils.zones.run('stepZone', step, callback); | ||
if (result instanceof Promise) return result.then(finalizer).catch(reportStepError); | ||
@@ -276,0 +272,0 @@ finalizer(); |
@@ -215,28 +215,14 @@ "use strict"; | ||
} | ||
function toHaveAccessibleName(locator, expected, options = {}) { | ||
if (Array.isArray(expected)) { | ||
return _toEqual.toEqual.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => { | ||
const expectedText = (0, _utils.serializeExpectedTextValues)(expected, { | ||
ignoreCase: options === null || options === void 0 ? void 0 : options.ignoreCase, | ||
normalizeWhiteSpace: true | ||
}); | ||
return await locator._expect('to.have.accessible.name.array', { | ||
expectedText, | ||
isNot, | ||
timeout | ||
}); | ||
}, expected, options); | ||
} else { | ||
return _toMatchText.toMatchText.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => { | ||
const expectedText = (0, _utils.serializeExpectedTextValues)([expected], { | ||
ignoreCase: options === null || options === void 0 ? void 0 : options.ignoreCase, | ||
normalizeWhiteSpace: true | ||
}); | ||
return await locator._expect('to.have.accessible.name', { | ||
expectedText, | ||
isNot, | ||
timeout | ||
}); | ||
}, expected, options); | ||
} | ||
function toHaveAccessibleName(locator, expected, options) { | ||
return _toMatchText.toMatchText.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => { | ||
const expectedText = (0, _utils.serializeExpectedTextValues)([expected], { | ||
ignoreCase: options === null || options === void 0 ? void 0 : options.ignoreCase, | ||
normalizeWhiteSpace: true | ||
}); | ||
return await locator._expect('to.have.accessible.name', { | ||
expectedText, | ||
isNot, | ||
timeout | ||
}); | ||
}, expected, options); | ||
} | ||
@@ -243,0 +229,0 @@ function toHaveAccessibleErrorMessage(locator, expected, options) { |
@@ -149,4 +149,4 @@ "use strict"; | ||
for (const a of attachments) { | ||
var _this$_expectStepId, _this$_parentStep; | ||
this._attach(a, (_this$_expectStepId = this._expectStepId()) !== null && _this$_expectStepId !== void 0 ? _this$_expectStepId : (_this$_parentStep = this._parentStep()) === null || _this$_parentStep === void 0 ? void 0 : _this$_parentStep.stepId); | ||
var _this$_parentStep; | ||
this._attach(a, (_this$_parentStep = this._parentStep()) === null || _this$_parentStep === void 0 ? void 0 : _this$_parentStep.stepId); | ||
} | ||
@@ -188,6 +188,2 @@ return this.attachments.length; | ||
} | ||
_expectStepId() { | ||
var _zones$zoneData2; | ||
return (_zones$zoneData2 = _utils.zones.zoneData('expectZone')) === null || _zones$zoneData2 === void 0 ? void 0 : _zones$zoneData2.stepId; | ||
} | ||
_addStep(data, parentStep) { | ||
@@ -194,0 +190,0 @@ var _parentStep, _parentStep2; |
{ | ||
"name": "playwright", | ||
"version": "1.50.0-alpha-2025-01-16", | ||
"version": "1.50.0-alpha-2025-01-17", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -59,3 +59,3 @@ "repository": { | ||
"dependencies": { | ||
"playwright-core": "1.50.0-alpha-2025-01-16" | ||
"playwright-core": "1.50.0-alpha-2025-01-17" | ||
}, | ||
@@ -62,0 +62,0 @@ "optionalDependencies": { |
Sorry, the diff of this file is too big to display
3173044
36242
+ Addedplaywright-core@1.50.0-alpha-2025-01-17(transitive)
- Removedplaywright-core@1.50.0-alpha-2025-01-16(transitive)