vic
vic

Reputation: 227

how to run one scenario from another Scenario in Specrun

I have a 2 scenarios .

@Joinnow
Scenario Outline: join as a user


@changePasswrd
Scenario Outline: Change Password

Now i want to run @Joinnow as a part of @change password initial step. How would i do that ?

Upvotes: 1

Views: 2012

Answers (2)

merrua
merrua

Reputation: 585

You might also want to think about a background. Why do you want to use the other scenario with this scenario? Do they share similar steps? Do you need it in a certain state? Or is it just to select the right user login? A background works well for using a particular user.

Cucumber link but it works the same in specflow https://github.com/cucumber/cucumber/wiki/Background

There is also setup with a tag, which will run before a scenario if you want. https://github.com/techtalk/SpecFlow/wiki/Hooks

Upvotes: 0

Sam Holder
Sam Holder

Reputation: 32936

to do this you can create a new step which calls all of the other steps in the other scenario. The specflow wiki has some details of how to do this and this answer also gives similar information

Upvotes: 1

Related Questions