1

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 ?

vic
  • 217
  • 1
  • 7
  • 18

2 Answers2

1

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

Community
  • 1
  • 1
Sam Holder
  • 32,535
  • 13
  • 101
  • 181
  • well i know i can share the steps but how about running whole @join now scenario with all of its parameter without sharing the steps ? – vic Nov 06 '15 at 03:26
  • You can't just 'call' the other scenario. You could copy the whole thing to s background in another feature, but it can't be a scenario outline then – Sam Holder Nov 06 '15 at 07:06
0

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

merrua
  • 575
  • 1
  • 4
  • 11