Closed rent-a-developer closed 2 years ago
Yeah, you can't have multiple feature files with the same feature title in the same folder. You need to change the feature title in the files.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
SpecFlow Version
3.9.22
Which test runner are you using?
MSTest
Test Runner Version Number
16.11.0
.NET Implementation
.NET 5.0
Project Format of the SpecFlow project
Sdk-style project format
.feature.cs files are generated using
SpecFlowSingleFileGenerator custom tool
Test Execution Method
Visual Studio Test Explorer
SpecFlow Section in app.config or content of specflow.json
{ "bindingCulture": { "name": "en-us" }, "language": { "feature": "en-us" }, "stepAssemblies": [ { "assembly": "SpecFlowSharedSteps" } ] }
Issue Description
I am not sure if this is a bug or if it is by design.
Is it possible to have multiple .feature files for the same feature? Example:
File "Features\FeatureA\ScenarioA.feature":
File "Features\FeatureA\ScenarioB.feature"
When I try this I get compilation errors, because for both .feature files the same class "FeatureAFeature" is generated.
Why do I even want to split one feature across multiple .feature files? Sometimes the scenarios of a feature are each pretty long / have a lot of steps. Therefore it would be nice if I could split the scenarios across multiple .feature files. Otherwise, when someone wants to navigate to a specific scenario they have to scroll a lot in one large .feature file.
Steps to Reproduce
Add the following files to a SpecFlow test project and build the project.
File "Features\FeatureA\ScenarioA.feature":
File "Features\FeatureA\ScenarioB.feature"
Link to Repro Project
No response