@ Url("owner/find.html")
public class FindOwnerScreen extends WebScreen{
@LocateBy(css="#search-owner-form input")
public ScreenElement searchTerms;
@LocateBy(css="##search-owner-form button")
public SearchElement searchButton;
An Action
代码语言:javascript复制
public class Enter extends WebDriverInteraction implements Perform{
private String text;
private ScreenElement field;
public void performAs(Actor actor){
web(actor).findElement(field.locator()).sendKeys(text);
}
public Enter(String text){this.text = text;}
public static Enter the(String text){return new Enter(text);}
public Perform into(ScreenElement field){
this.field = field;
return this;
}
}