SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Async feature background not awaited in beta version (NET 6)

Open RadtkeJCJ opened this issue 3 years ago • 0 comments

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

  1. Create a scenario which depends on an async Given step
  2. Scenario should pass
  3. Move the async Given step to the feature background section
  4. Scenario will fail as execution does not await the Given step

Link to Repro Project

No response

RadtkeJCJ avatar Jun 21 '22 09:06 RadtkeJCJ