テスト自動化のためのいくつかの異なるフレームワークを評価しています。WatiNについて私が本当に気に入っていることの1つは、テストからページコードを抽象化するためのページモデルです。
ログインページのWatinの例:
public class AVLoginPage : Page
{
public TextField Email
{
get { return Document.TextField(Find.ById("UserLogin_UserName")); }
}
public TextField Password
{
get { return Document.TextField(Find.ById("UserLogin_Password")); }
}
public Button LoginBtn
{
get { return Document.Button(Find.ById("UserLogin_LoginButton")); }
}
/// <summary>
/// Enters the email and loging in to the corresponding boxes and clicks the login button.
/// </summary>
/// <param name="email"></param>
/// <param name="password"></param>
public void Login(string email, string password)
{
Email.TypeText(email);
Password.TypeText(password);
LoginBtn.Click();
}
}
WebAiiでこのようなことをすることはできますか?