playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: add describe text in expect report message

Open sfinksik12 opened this issue 7 months ago • 0 comments

🚀 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

Image

Motivation

expect message test in allure report

sfinksik12 avatar Jun 14 '25 13:06 sfinksik12