Scope binding doesn't work after migration from Specflow (Ambiguous Steps) #607
Replies: 5 comments 2 replies
-
|
Could you please list the used packages in your project? And please clear your obj/bin folders |
Beta Was this translation helpful? Give feedback.
-
|
I cannot recreate with a simple example. |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately, I can't post reproduction project. I can't reproduce this behavior on a new project. And obviously I can't post the project I am working on. Also I noticed, that Before/AfterScenario hooks work fall all tests from all step definition files. For example, I have 3 feature files with 3 tests in each. In the logs I see, that for every test all 3 BeforeScenario and 3 AfterScenario are called Is there a way to trace why Reqnroll works this way? |
Beta Was this translation helpful? Give feedback.
-
|
Is the Do you use the SpecFlow compatibility package? |
Beta Was this translation helpful? Give feedback.
-
|
I believe the problem is in the BindingSourceProcessor GetScopes() method private IEnumerable<BindingScope> GetScopes(IEnumerable<BindingSourceAttribute> attributes)
{
return attributes.Where(attr => attr.AttributeType.TypeEquals(typeof(ScopeAttribute)))
.Select(attr => new BindingScope(attr.TryGetAttributeValue<string>("Tag"), attr.TryGetAttributeValue<string>("Feature"), attr.TryGetAttributeValue<string>("Scenario")));
}This method takes a list of Binding attributes that have been applied to a member and filters them down to those that are But in this situation, the ScopeAttribute is actually of type Because of this mismatch, the Scope is not recognized and the binding methods are treated as if they had no scope (and thus an ambiguous match results). Is this worth fixing? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reqnroll Version
2.4.1
Which test runner are you using?
MSTest
Test Runner Version Number
3.8.3
.NET Implementation
.NET 8.0
Test Execution Method
Visual Studio Test Explorer
Content of reqnroll.json configuration file
For now it is stil specflow.json
{
"runtime": {
"missingOrPendingStepsOutcome": "Error"
}
}
Issue Description
After migrating from SpecFlow 3.9.74 to Reqnroll 2.4.1, I started seeing "Ambiguous Steps" errors for some step definitions. The
Scopeattribute, with different tags and features, does not seem to take effect.SpecFlow extension for VS is disabled and Reqnroll extension is installed.
Where should I look to solve\debug this issue?
Link to Repro Project
No response
Beta Was this translation helpful? Give feedback.
All reactions