I have a feature and was looking for a way to execute it different per environment. Like I might have an environment where I test things locally and another that hits remote servers. Using scoped bindings I can accomplish this but it requires duplicating the scenarios and then applying a tag to each scenario.
Eg:
@test
Scenario: User can login
When a user provides valid credentials
Then they are logged in
@stage
Scenario: User can login
When a user provides valid credentials
Then they are logged in
Is instead there a way where the scenario is only listed once in the feature and then I have some kind of global tag that would allow the proper filtering of step definitions?
Thanks!
this is what the .net configuration infrastructure is for. it’s not really specflow specific. your code should read different configuration settings and you should have the right configuration files for given environments. i would do this in the same way you do your configuration for moving your application code through different environments.