playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Question] Is there a way to list all the tags via CLI?

Open qk5 opened this issue 1 year ago • 3 comments

The new tags feature introduced in version 1.42.0 is fantastic!

I am curious if there is a way to list all tags, similar to the command below that lists all the tests: npx playwright test --list

Perhaps something like: npx playwright test --list-tags

This would be beneficial for our large team, including both on-site and offshore engineers. It can help address potential discrepancies where engineers may use similar tags like 'E2E,' 'End2End,' or 'EndToEnd' interchangeably. Thus, making it easy for us to consolidate the tags.

qk5 avatar Mar 13 '24 20:03 qk5

There is not, I marked it as a feature request. In the meantime you could create a custom reporter which will get invoked with --reporter=./customTagListReporter.ts --list and in there you store all the tags you have in your project and list them afterwards.

mxschmitt avatar Mar 13 '24 22:03 mxschmitt

I want to have access to tags in the tests, maybe through testInfo like testInfo.title, testInfo.annotations. There can be testInfo.tags

TerenceTian625 avatar Mar 15 '24 00:03 TerenceTian625

Exposing tags in TestInfo was merged last week as per https://github.com/microsoft/playwright/pull/29794. But this request is different, instead the value can be used inside the reporter land via the existing TestCase.tags.

mxschmitt avatar Mar 15 '24 09:03 mxschmitt