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.91k stars 3.67k forks source link

[Feature]: Append a custom Tag in test title during test execution #33521

Open codesmple opened 4 days ago

codesmple commented 4 days ago

🚀 Feature Request

Append or update test title during test execution. Is there any way to append a custom tag in test title during the test execution? Use case -

Example

There is previous request regrading the same - https://github.com/microsoft/playwright/issues/23160 but the workaround is specific to tests or any fixture.

Motivation

This feature can provide lot of flexibility in reporting and tagging tests dynamically during the execution.

yury-s commented 4 days ago

See discussion on a similar report https://github.com/microsoft/playwright/issues/32925 and why we don't want to support that. Would the workaround described in that issue work for you?

Basically you can add dynamic tags as annotations in runtime and filter them in the html report using annot:@foo query:

test('test', async ({ page }) => {
  test.info().annotations.push({ type: '@foo' });
  await page.goto('https://playwright.dev/');
});
codesmple commented 3 days ago

This workaround add an annotation which is not visible in the html summary report for all tests. This is only shown when the individual test result is opened.

If we show any annotation as a tag in index html, that will increase the readability from the user perspective. Is there any plan to enhance the feature to show any custom annotation as a tag in index html summary similar like - https://github.com/microsoft/playwright/issues/32925#issuecomment-2388689374

Image