Home

Awesome

darcy-ui

Build Status Coverage Status Stories in Ready

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:

Darcy is divided into modules. This module, darcy-ui, defines a general purpose API for all types of user interfaces. darcy-web extends the API for web browser automation.

example page object

import static com.redhat.darcy.ui.elements.Elements.textInput;
import static com.redhat.darcy.ui.elements.Elements.button;
import static com.redhat.synq.Synq.after;

@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 InvalidLoginException(credentials, errorMsg::readText))
        .waitUpTo(1, MINUTES);
  }
}

getting started

Check out the Automating Applications with Darcy GitBook to learn more about darcy.

contributing

Try it out and open an issue if you don't like something! Pull requests welcome and encouraged! Please read the documentation to get started, and check out the issue list if you're looking for something to do.

license

darcy is licensed under version 3 of the GPL.