microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
192 stars 6 forks source link

[SUGGESTION] Filter Tests in Test Explorer by tags provided by test categories/traits #1049

Open HeimarChrist opened 1 month ago

HeimarChrist commented 1 month ago

Describe the feature you'd like

As a tester using the extension, I would like to request the addition of a feature that allows filtering of tests in the Test Explorer view by the test tags. This feature would greatly enhance the usability of the extension and improve the efficiency of test execution and debugging specifically tagged tests.

The proposed feature should support the following testing frameworks:

Note: The category can be added to the Tags of the Test Items in the test controller. Categorize test cases or classes -> [Category()] | [TestCategory(“)] | [Trait(“Category”, “”)

I believe this feature would be a valuable addition to the extension and would greatly improve the user experience. Thank you for considering this request.

Alternatives considered

No response

Environment Information

No response

HeimarChrist commented 1 month ago

Example was done with the test controller of the C# Dev Kit API

image

timheuer commented 1 month ago

I love this idea...I wish more repos used traits! The screenshot you have here you mentioned you already implemented this on your own @HeimarChrist?

HeimarChrist commented 1 month ago

@timheuer, I implemented it in a VsCode extension I am writing but it has some drawbacks. I utilized the exported API of the C# Dev Kit to attach to the Test Controller, then I iterate through the test items which have URI values and use Regex to read the Trait/Category/TestCategory attributes and Create TestTag items for each TestItem with all the found values.

Issues - I am facing:

Solutions - I believe will work: