0
votes

Or from other place..

  • What I want: get all scenario names on start test, but without start all tests.
  • What I tried: by assembly reflection I scanned content, but one contain only feature names and method names. Not scenario names. (from this: Get list of tests in nunit library programmatically without having to run tests) Also exist ScenarioContext, but it contain only current names. Not all existing in testsuite.

What i am using:

  • Specflow for describe.
  • NUnit for run. VS2019.
  • TestRail for result collect. TestSuite contains testName equal test describe in Specflow.

I hope it possible. Thanks to all!

You can have a look at the .feature.cs files generated from each feature file. They should be NUnit test classes. You should be able to use class reflection to read the attributes over the class names and methods.Greg Burghardt
Thank U,Greg! Yes, I tried get attributes through NUnit class reflection. Here my code: pastebin.com/hfve49A2 In .feature.cs class generated scenario name contains in [NUnit.Framework.DescriptionAttribute("First method. SaveForExample")] I researched and obtain inherinatce DescriptionAttribute : PropertyAttribute. github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/… And PropertyAttribute.cs contains readonly PropertyBag properties = new PropertyBag(); and property Properties. But I do`nt have result. =(aleksefy