Replies: 5 comments
-
As a workaround. I usually run code coverage and then you'll get a nice overview as well. Any steps with 0% coverage are unused. |
Beta Was this translation helpful? Give feedback.
-
@lilwa29 Yes, I also have this on my wish list for long time. If anyone would like to try implementing this, I think the "Find step definition usages" command is a good start. That also goes through all steps of all feature files in order to find matches with the current step definition. This new command could do something similar, but just collect all matches and finally exclude that from the full set of step definitions. I'm happy to help if you get stuck. |
Beta Was this translation helpful? Give feedback.
-
I will make an attempt at this. My understanding is that this feature will need to find all Binding classes and from that all methods marked with a Step attribute (Given, When, Then, etc) and for each run the same algorithm as the existing 'Find step definition usages' command. Those methods that have no usages are those we want right? I will try to get that far and then report back. May need some help later getting this wired up to the UI (menu items, dialog boxes, etc). @gasparnagy - I see in the Reqnroll.VisualStudio solution that there appears to be functionality that duplicates or is very similar to code already in Reqnroll (eg, code to parse feature files, code to match Steps with StepDefinitions, etc.) Why was this approach taken? (versus having the VS extension call in to the Reqnroll functionality directly). I'm curious about the rationale/reasoning that went in to this design. |
Beta Was this translation helpful? Give feedback.
-
Proof of Concept PR submitted: here I think this is close but not quite ready. I suspect it will report multiple "unused" for a single Step method for each Given/When/Then Attribute applied to that Method (when those attributes don't match with feature steps). These should probably be deduplicated. |
Beta Was this translation helpful? Give feedback.
-
@clrudolphi Notes on the high level VSext concept:
This is what came to my mind now, I will also check the PR and make more comments. If anything I wrote is unclear, please let me know. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
We are using
ReqNRoll.VisualStudio
extension for our projects. We have thousands of feature files that need to be maintained, and sometimes it is hard to visualize which steps are not used anymore.Could you please consider to add a way to view unused step definitions, which need to be cleanup?
Maybe a kind of Intellisense "highlight" like an analyzer would do (Example: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1801).
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions