typescript - How to disable step logging into Allure report - Stack Overflow

admin2025-04-15  1

I would like to disable some steps in appearing in Allure Report.

I have tried adding steps inside "try" "catch" but it still triggers an entry into both Playwright default report and allure report.

I don't want the steps inside try try catch to appear in the report.

  for (const getLocator of locators) {
      const element = getLocator(page);
      try {
        if (await element.isVisible()) {
        console.log(`✅ Valid locator found: ${await element.evaluate(el => el.outerHTML)}`);
          return element;
        }
      } catch (error) {
        // Ignoring locator visibility errors to avoid polluting the report
      }
    }
转载请注明原文地址:http://www.anycun.com/QandA/1744712220a86570.html