playwright
playwright copied to clipboard
[Feature]: add describe text in expect report message
🚀 Feature Request
in 1.53 locator method add .describe() function i want expect text in allure report
in expect.js input this code
function createMatchers(actual, info, prefix) {
let locatorDesc = "";
try {
if (actual && typeof actual.toString === "function") {
locatorDesc = String(actual.toString());
}
} catch {
// ignore
}
const extendedInfo = { ...info, _pwLocatorDesc: locatorDesc };
return new Proxy((0, import_expectBundle.expect)(actual), new ExpectMetaInfoProxyHandler(extendedInfo, prefix));
}
and get method
const defaultTitle = `${locatorPart}${this._info.poll ? "poll " : ""}${this._info.isSoft ? "soft " : ""}${this._info.isNot ? "not " : ""}${matcherName}${argsSuffix}`;
const title = customMessage || defaultTitle;
Example
Motivation
expect message test in allure report