无法从 SpecFlow 步骤定义中调用 Given、When 或 Then
Can't call Given, When or Then from inside a SpecFlow step definition
我有一个步骤定义,我希望在其中调用另一个步骤,但它不会编译:
[Given(@"I am on the (.*) page")]
public void GivenIAmOnThePage(string url)
{
Given(@"I click the login button"); // cannot find this Given() SpecFlow library method
}
构建时我得到:
The name 'Given' does not exist in the current context
我有这个 using 语句,VS 不建议任何其他人来完成代码:
using TechTalk.SpecFlow;
我错过了 TechTalk.SpecFlow.Steps
class...
的继承
public class PageNavigation : Steps
{
...
}
我有一个步骤定义,我希望在其中调用另一个步骤,但它不会编译:
[Given(@"I am on the (.*) page")]
public void GivenIAmOnThePage(string url)
{
Given(@"I click the login button"); // cannot find this Given() SpecFlow library method
}
构建时我得到:
The name 'Given' does not exist in the current context
我有这个 using 语句,VS 不建议任何其他人来完成代码:
using TechTalk.SpecFlow;
我错过了 TechTalk.SpecFlow.Steps
class...
public class PageNavigation : Steps
{
...
}