cashanzlo
cashanzlo

Reputation: 121

How do I make scenarios dependent on each other in Gherkin using C#

I have two different scenario's running in MS Visual Studio. I have to make scenarios dependent on each other (say, implementing a simple login Page and making it dependent to its dashboard page). Some say Hooks are best methods in JVM. Help me out in c#

Upvotes: 0

Views: 486

Answers (1)

Thomas Sundberg
Thomas Sundberg

Reputation: 4343

I would do whatever it takes not to make scenarios depending on each other.

Given this you may wonder why? Should you duplicate the functionality instead? No, you should not duplicate steps in each scenario.

My approach would to implement a helper method, or many, that assists with logging in whenever needed. Logging in may, and often is, an incidental detail that blur the purpose with the scenario. The core of your scenario is probably not to log in, it is probably something else that is valuable for the current user. Something they can't do if they are not logged in. I would focus on the task they are aiming for and allow the logging in be an implementation detail when the steps are implemented later.

This would be my approach to avoid making scenarios depend on each other.

Upvotes: 2

Related Questions