SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.24k stars 754 forks source link

Test execution is not able to find scenarios with example data specified #2722

Open ashirulkar opened 1 year ago

ashirulkar commented 1 year ago

SpecFlow Version

3.9.74

Which test runner are you using?

xUnit

Test Runner Version Number

v3+

.NET Implementation

.NET 6.0

Project Format of the SpecFlow project

Sdk-style project format

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Command line – PLEASE SPECIFY THE FULL COMMAND LINE

SpecFlow Section in app.config or content of specflow.json

dotnet test ..**\SpecflowTemplateTest.dll --no-build --filter “DisplayName=User should be able to sell a product one|Displayname=User should be able to sell a product twoProductName: “Newproduct””

Issue Description

For the scenarios with Examples (test data) the command is simply skipping execution of those scenarios since the names specified in the dotnet test has concatenated the example data to the test case name. e.g. dotnet test ..**\SpecflowTemplateTest.dll --no-build --filter “DisplayName=User should be able to sell a product one|Displayname=User should be able to sell a product twoProductName: “Newproduct””

Here in the 2nd step second Test of User should be able to sell a product twoProductName: “Newproduct” has test data of productName associated with it, when we execute this command it simply skips this scenario execution and execute only 1st scenario mentioned i.e. “User should be able to sell a product one” which is without example data.

Steps to Reproduce

Create the Scenario with Example Run the scenario with above mentioned command

Link to Repro Project

No response

ashirulkar commented 1 year ago

Can someone please share the dotnet test command to execute the scenario filtering with DisplayName and has example specified?