serenity-bdd-skill — Claude Code skill for Java tests
serenity-bdd-skill is a Claude Code skill that creates Java BDD tests with Serenity and the Screenplay pattern. It activates for requests about Serenity, @Steps, or Serenity reports.
MIT 223 installs ★ 393 updated 2026-10-13
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a claude-codeWhat serenity-bdd-skill does
The skill helps build Java tests with Serenity step libraries or Screenplay. It also covers Cucumber integration and HTML report generation with mvn verify.
Examples include a JUnit 5 test, login steps, and a Screenplay actor action. Running the tests requires Maven and the serenity-core, serenity-junit5, and serenity-screenplay-webdriver dependencies. Cloud runs through LambdaTest need the serenity-lambdatest dependency plus the LT_USERNAME and LT_ACCESS_KEY credentials.
What it helps with
- write Java BDD tests with Serenity steps
- model user actions with Screenplay
- generate an HTML report after test runs
- connect Serenity tests to LambdaTest
Example prompts for the agent
- Create a Java BDD test with Serenity and
@Stepsfor a login flow. - Rewrite the login scenario using the Screenplay pattern.
- Configure Serenity tests to run through LambdaTest.
How to install serenity-bdd-skill
1Skills CLI (Vercel)
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a claude-code2Manually: put the files in place
~/.claude/skills/serenity-bdd-skill/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/serenity-bdd-skill/
1Skills CLI (Vercel)
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a codex2Manually: put the files in place
.agents/skills/serenity-bdd-skill/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a cursor2Manually: put the files in place
.cursor/skills/serenity-bdd-skill/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install LambdaTest/agent-skills serenity-bdd-skill2Manually: put the files in place
.github/skills/serenity-bdd-skill/SKILL.md1Skills CLI (Vercel)
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a gemini-cli2Platform CLI
gemini skills install https://github.com/LambdaTest/agent-skills --path serenity-bdd-skillManually: put the files in place
.devin/skills/serenity-bdd-skill/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about serenity-bdd-skill
How do I install serenity-bdd-skill in Claude Code?
Run npx skills add LambdaTest/agent-skills --skill serenity-bdd-skill -a claude-code. The skill file is at ~/.claude/skills/serenity-bdd-skill/SKILL.md.
What does serenity-bdd-skill do?
It helps create Java BDD tests with Serenity, including @Steps libraries, Screenplay actions, and HTML report generation.
What does serenity-bdd-skill require?
Test runs need Maven and the serenity-core, serenity-junit5, and serenity-screenplay-webdriver dependencies. LambdaTest cloud runs also require serenity-lambdatest and the LT_USERNAME and LT_ACCESS_KEY credentials.
Source text
SKILL.md · MIT
---
name: serenity-bdd-skill
description: >
Generates Serenity BDD tests in Java with Screenplay pattern, rich reporting,
and Cucumber integration. Use when user mentions "Serenity", "Screenplay",
"@Steps", "Serenity BDD". Triggers on: "Serenity BDD", "Screenplay pattern",
"@Steps", "Serenity report".
languages:
- Java
category: bdd-testing
license: MIT
metadata:
author: TestMu AI
version: "1.0"
---
# Serenity BDD Skill
## Core Patterns
### Step Library Pattern
```java
import net.serenitybdd.annotations.Step;
import net.serenitybdd.core.pages.PageObject;
public class LoginSteps extends PageObject {
@Step("Navigate to login page")
public void navigateToLogin() {
openUrl(getDriver().getCurrentUrl() + "/login");
}
@Step("Enter email: {0}")
public void enterEmail(String email) {
find(By.id("email")).sendKeys(email);
}
@Step("Enter password")
public void enterPassword(String password) {
find(By.id("password")).sendKeys(password);
}
@Step("Click login button")
public void clickLogin() {
find(By.cssSelector("button[type='submit']")).click();
}
@Step("Should see the dashboard")
public void shouldSeeDashboard() {
assertThat(getDriver().getCurrentUrl()).contains("/dashboard");
assertThat(find(By.cssSelector(".welcome")).isDisplayed()).isTrue();
}
}
```
### Test Class
```java
import net.serenitybdd.junit5.SerenityJUnit5Extension;
import net.serenitybdd.annotations.Steps;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(SerenityJUnit5Extension.class)
public class LoginTest {
@Steps LoginSteps loginSteps;
@Test
void shouldLoginWithValidCredentials() {
loginSteps.navigateToLogin();
loginSteps.enterEmail("[email protected]");
loginSteps.enterPassword("password123");
loginSteps.clickLogin();
loginSteps.shouldSeeDashboard();
}
}
```
### Screenplay Pattern
```java
import net.serenitybdd.screenplay.*;
public class Login implements Performable {
private final String email, password;
public Login(String email, String password) {
this.email = email; this.password = password;
}
@Override
public <T extends Actor> void performAs(T actor) {
actor.attemptsTo(
Enter.theValue(email).into(LoginPage.EMAIL_FIELD),
Enter.theValue(password).into(LoginPage.PASSWORD_FIELD),
Click.on(LoginPage.LOGIN_BUTTON)
);
}
public static Login withCredentials(String email, String password) {
return new Login(email, password);
}
}
// Usage
actor.attemptsTo(Login.withCredentials("[email protected]", "pass123"));
actor.should(seeThat(TheWebPage.currentUrl(), containsString("/dashboard")));
```
### Reporting
```bash
# Run tests — generates rich HTML report
mvn verify
# Report at: target/site/serenity/index.html
```
### Cloud Execution on TestMu AI
Add the `serenity-lambdatest` plugin dependency:
```xml
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-lambdatest</artifactId>
<version>${serenity.version}</version>
</dependency>
```
Configure `serenity.conf`:
```hocon
webdriver {
driver = remote
remote.url = "https://"${LT_USERNAME}":"${LT_ACCESS_KEY}"@hub.lambdatest.com/wd/hub"
}
serenity {
take.screenshots = AFTER_EACH_STEP
}
lambdatest {
build = "Serenity Build"
}
# LT:Options capabilities
"LT:Options" {
platformName = "Windows 11"
browserVersion = "latest"
visual = true
video = true
console = true
network = true
}
```
Or configure via `serenity.properties`:
```properties
webdriver.driver=remote
webdriver.remote.url=https://hub.lambdatest.com/wd/hub
lt.user=${LT_USERNAME}
lt.key=${LT_ACCESS_KEY}
lt.platform=Windows 11
lt.browserName=chrome
```
## Setup: Maven with `serenity-core`, `serenity-junit5`, `serenity-screenplay-webdriver`, `serenity-lambdatest`
## Run: `mvn verify` (generates living documentation)
## Deep Patterns
For advanced patterns, debugging guides, CI/CD integration, and best practices,
see `reference/playbook.md`.
© TestMu AI · MIT · LambdaTest/agent-skills