microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.8k stars 3.66k forks source link

[Feature]: Allow to hide selected actions from HTML Report #33287

Open AdamOakman opened 2 weeks ago

AdamOakman commented 2 weeks ago

🚀 Feature Request

Let's say I have a locatorHandler for detecting and waiting for some unexpected animations registered as part of an autofixture - I would like to be able to hide all waitFor calls from the report to avoid unnecessary irrelevant noise information that is printed out in the HTML report in between relevant test.steps.

I don't want to put it in test.step block, I would like to hide it completely.

    waitForNgAnimations: [false, { option: true }],
    registerNgAnimationsWaitingHandler: [
        async ({ page, waitForNgAnimations }, use) => {
            if (waitForNgAnimations) {
                await page.addLocatorHandler(page.locator('.ng-animating').first(), async () => {
                    for (const element of await page.locator('.ng-animating').all()) {
                        await element.waitFor({ state: 'detached' });
                    }
                });
            }
            await use();
        },
        { auto: true }
    ]

Image

Example

No response

Motivation

Reduce noisiness in HTML report for actions that do not come explicitely from spec file

kosteklvp commented 2 days ago

Is there already any workaround to hide page or locator methods completely from report?