1

我有 2 个场景。

@Joinnow
Scenario Outline: join as a user


@changePasswrd
Scenario Outline: Change Password

现在我想运行@Joinnow 作为@change 密码初始步骤的一部分。我该怎么做?

4

2 回答 2

1

为此,您可以创建一个新步骤,该步骤调用其他场景中的所有其他步骤。specflow wiki 有一些关于如何做到这一点的细节,这个答案提供了类似的信息

于 2015-11-05T23:28:07.323 回答
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

于 2015-11-11T09:39:59.467 回答