Darcy is a framework for writing page objects in order to automate interaction with graphical user interfaces. Page objects are classes that model what a user can see and do with a specific page.
Key features:
Thread.sleep
!@RequireAll
public class MyHomePage extends AbstractView {
private TextInput login = textInput(By.id("login"));
private TextInput password = textInput(By.id("password"));
private Button submit = button(By.id("submit"));
@NotRequired
private Label errorMsg = label(By.className("error"));
public AccountDetails login(Credentials credentials) {
login.clearAndType(credentials.login());
password.clearAndType(credentials.password());
return after(submit::click)
.expect(transition().to(new AccountDetails())
.failIf(errorMsg::isDisplayed)
.throwing(new LoginException(credentials, errorMsg::readText))
.waitUpTo(1, MINUTES);
}
}
This project, including this documentation, are works in progress. I welcome your feedback (and perhaps even contributions!) on the project and the documentation. Feel free to open an issue or submit a pull request: http://github.com/darcy-framework.