Serenity BDD is an open-source framework for organizing and reporting BDD test results. It supports executable specifications, UI automation, and delivery evidence connected to product-backlog items. section 3.5.1 section 16.3
Serenity BDD contributes practical support across the automation workflow:
- Creates a Maven project from a Serenity Cucumber Starter template and produces test reports. section 3.5.1
- Simplifies Page Objects by managing WebDriver lifecycle, instantiating page fields, and extending WebDriver interactions. section 11.3.10
- Links features, rules, and examples to JIRA issues through the @Issue tag and report integration. section 16.3
A Serenity page object
A LoginPage extends PageObject, declares WebElementFacade fields, and uses type() to enter credentials before clicking the login button. Step definitions can open the page and call signinWithCredentials without explicitly creating the page object. section 11.3.10
@DefaultUrl("/login") #1
public class LoginPage extends PageObject { #2
@FindBy(id="email")
WebElementFacade email; #3
@FindBy(id="password")
WebElementFacade password;
@FindBy(id="login-button")
WebElementFacade loginButton;
public void signinWithCredentials(String emailValue,
String passwordValue) {
email.type(emailValue); #4
password.type(passwordValue); #4
loginButton.click();
}
}
Shows the annotated LoginPage implementation and its concise authentication method. section 11.3.10
