我正在嘗試使用Specflow,NUnit和WatiN進行一些BDD測試。我正在使用TestDriven.NEt來運行測試。這是我的第一個測試:NUnit,TestDriven.NET,WatiN和Specflow
[Binding]
[TestFixture, RequiresSTA]
public class RegisterUserSteps
{
private IE _ie = new IE();
[When(@"the user visits the registration page")]
public void WhenTheUserVisitsTheRegistrationPage()
{
_ie.GoTo("http://localhost:1064/Register/");
}
[When(@"enter the following information")]
public void WhenEnterTheFollowingInformation(Table table)
{
foreach(var tableRow in table.Rows)
{
var field = _ie.TextField(Find.ByName(tableRow["Field"]));
if(!field.Exists)
{
Assert.Fail("Field does not exists!");
}
field.TypeText(tableRow["Value"]);
}
}
[When(@"click the ""Register"" button")]
public void WhenClickTheRegisterButton()
{
ScenarioContext.Current.Pending();
}
[Then(@"the user should be registered")]
public void ThenTheUserShouldBeRegistered()
{
ScenarioContext.Current.Pending();
}
}
的問題是,它從未進入到
[When(@"enter the following information")]
public void WhenEnterTheFollowingInformation(Table table)
它只是啓動瀏覽器並執行的第一步。我錯過了什麼嗎?
你能後的實際特徵的文字? – Andy 2012-02-20 03:11:48