2

I have a method which runs Before a feature like so,

[BeforeFeature, Scope(Feature = "Feature1"]
Method()
{
}

I want the same method to be ran for another feature file that i've wiritten i.e. Feature2

How do i combine this "Feature2" in the scope Binding?

I tried this

[BeforeFeature, Scope(Feature = "Feature1"]
[Scope(Feature="Feature2")]

but didn't work. The method only runs for Feature1 and not for Feature2

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
AutomateFr33k
  • 562
  • 2
  • 8
  • 26
  • Solution here (DavideGalifi comment): https://stackoverflow.com/questions/19180578/specflow-and-reusing-steps-from-another-feature/41891994#41891994 – Rafael O. Teixeira Sep 30 '22 at 17:16

1 Answers1

2

According to the scoping rules multiple Scope bindings will be OR'd so I would expect the second example to work. Are you sure that you are spelling the feature name correctly?

I'll try and get an example worked up to verify this behaviour.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181