SpecFlow
SpecFlow copied to clipboard
Async feature background not awaited in beta version (NET 6)
SpecFlow Version
3.10.2-beta
Which test runner are you using?
xUnit
Test Runner Version Number
2.4.3
.NET Implementation
.NET 5.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
Feature background given steps are not awaited - scenarios work correctly with the same step explicitly specified as a Given.
I see the generated .feature.cs file is creating lines for feature backgrounds which are missing an await:
this.FeatureBackgroundAsync();
The given steps look like this:
await testRunner.GivenAsync("<snip>", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
Steps to Reproduce
- Create a scenario which depends on an async
Givenstep - Scenario should pass
- Move the async
Givenstep to the feature background section - Scenario will fail as execution does not await the
Givenstep
Link to Repro Project
No response