Closed bgoggan closed 1 year ago
https://docs.specflow.org/projects/specflow/en/latest/Extend/Decorators.html
Thanks @Constante-ou-Mort I believe I followed all the documentation properly and yet when I attached my generator plugin package to my existing test package and add my "Order" attribute to the scenario nothing is created in the feature.cs file, other than the CategoryAttribute of "Order". I feel like my package isn't being recognized. I uploaded what I did at the link below. Would you be able to check it out and see if I'm missing anything?
@gasparnagy @SabotageAndi Sorry to bother you both but I believe I followed the documentation sent in the link about creating a custom generator but I cannot get my tests to recognize it. Are either of you able to give a quick review of what I built in the link in my previous comment to see if I missed something? When I install the nuget package into my test projects and re-build I do not get an Order attribute added as expected but I cannot see why. Thanks in advance for any assistance you can provide.
@bgoggan Please send me the code or the link. I'll try to check it.
@bgoggan Please send me the code or the link. I'll try to check it. @gasparnagy You need a link to my package assigned to a test project? I have the link to the generator package I built above?
@bgoggan ah sorry. i meant the source code of the plugin, but i missed that you have shared the link already in your comment.
@gasparnagy no problem. I appreciate any help you can provide. Thanks.
@bgoggan I'm doing a course this week until Thu, so it might be that I can only look at that on Friday. But I have it on my TODO list now.
@gasparnagy Sounds good. Thanks.
@bgoggan Based on my quick review, I found:
NUnitOrder.SpecFlowPlugin
, make sure that:
NUnitOrder.SpecFlowPlugin.props
, NUnitOrder.SpecFlowPlugin.targets
)NUnitOrder.SpecFlowPlugin.nuspec
), but this is just a convention/NUnitOrder.SpecFlowPlugin
(I usually also use the same project file name and don't set the assembly name in the project file to avoid confusion). You need to fix the assembly name in the targets file and the nuspec file as well!@gasparnagy Wow, I can't believe it was something that simple. I didn't even see the warnings in the build but they jumped right out at me after your comment. I really appreciate your help on that. I made the suggested changes and I can now see the attribute being added. Have a great weekend. I'll close the ticket.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
SpecFlow Version
3.9.74
Which test runner are you using?
NUnit
Test Runner Version Number
3.9.74
.NET Implementation
.NET 6.0
Project Format of the SpecFlow project
Classic project format using
<PackageReference>
tags.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation NuGet package
Test Execution Method
Visual Studio Test Explorer
SpecFlow Section in app.config or content of specflow.json
No response
Issue Description
Reading the NUnit documentation it appears you could add an Order attribute to the tests to ensure a particular order of execution. I'm wondering if there is a way for us to add that same attribute to either the Feature or Scenario level in Specflow?
Steps to Reproduce
N/A
Link to Repro Project
No response