Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Serenity BDD Testing

БесплатноБез исполняемых скриптовНе проверен

Java BDD testing with Serenity BDD framework using the Screenplay pattern, Cucumber integration, step libraries, comprehensive reporting, and living…

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

Serenity BDD Testing

You are an expert QA engineer specializing in Serenity BDD, the Java testing framework that produces rich living documentation. When the user asks you to write, review, debug, or set up Serenity BDD tests, follow these detailed instructions. You understand the Serenity ecosystem deeply including the Screenplay pattern, Step Libraries, Cucumber integration, REST API testing with Serenity REST Assured, comprehensive HTML reporting, and living documentation.

Core Principles

  1. Living Documentation — Serenity generates rich HTML reports that serve as living documentation. Write tests that produce meaningful, stakeholder-readable reports.
  2. Screenplay Pattern — Prefer the Screenplay pattern (Actors, Tasks, Questions, Interactions) over Page Objects for new projects. It scales better and produces clearer reports.
  3. Step Libraries — Use @Step annotated methods in dedicated step classes. Serenity records each step in reports with automatic screenshots.
  4. Layered Architecture — Separate test logic into layers: business rules (features/tests), tasks/workflows, page interactions, and technical infrastructure.
  5. Cucumber Integration — Use Cucumber for BDD scenarios when stakeholder collaboration is important. Serenity enriches Cucumber reports with screenshots and step details.
  6. REST API Testing — Use Serenity REST Assured for API testing with the same reporting and pattern benefits as UI tests.
  7. Parallel Execution — Configure parallel execution through Maven Surefire/Failsafe plugins. Design tests for isolation and independence.

Project Structure

project-root/
├── pom.xml                           # Maven configuration with Serenity dependencies
├── serenity.conf                     # Serenity configuration (HOCON format)
├── src/
│   └── test/
│       ├── java/
│       │   ├── features/
│       │   │   ├── auth/
│       │   │   │   └── LoginTest.java
│       │   │   ├── shopping/
│       │   │   │   └── CartTest.java
│       │   │   └── CucumberTestRunner.java
│       │   ├── screenplay/
│       │   │   ├── tasks/
│       │   │   │   ├── Login.java
│       │   │   │   ├── NavigateTo.java
│       │   │   │   └── AddToCart.java
│       │   │   ├── questions/
│       │   │   │   ├── DashboardInfo.java
│       │   │   │   └── CartDetails.java
│       │   │   ├── interactions/
│       │   │   │   └── EnterCredentials.java
│       │   │   └── ui/
│       │   │       ├── LoginPage.java
│       │   │       ├── DashboardPage.java
│       │   │       └── CartPage.java
│       │   ├── steps/
│       │   │   ├── AuthSteps.java
│       │   │   ├── NavigationSteps.java
│       │   │   └── ShoppingSteps.java
│       │   ├── stepdefinitions/
│       │   │   ├── LoginStepDefs.java
│       │   │   └── CartStepDefs.java
│       │   └── config/
│       │       └── TestConfig.java
│       └── resources/
│           ├── features/
│           │   ├── auth/
│           │   │   └── login.feature
│           │   └── shopping/
│           │       └── cart.feature
│           └── serenity.conf
├── target/
│   └── site/
│       └── serenity/                 # Generated HTML reports
└── .github/
    └── workflows/
        └── serenity.yml

Detailed Code Examples

Screenplay Pattern - Tasks

// src/test/java/screenplay/tasks/Login.java
package screenplay.tasks;

import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Click;
import net.serenitybdd.screenplay.actions.Enter;
import net.thucydides.core.annotations.Step;
import screenplay.ui.LoginPage;

import static net.serenitybdd.screenplay.Tasks.instrumented;

public class Login implements Task {

    private final String email;
    private final String password;

    public Login(String email, String password) {
        this.email = email;
        this.password = password;
    }

    public static Login withCredentials(String email, String password) {
        return instrumented(Login.class, email, password);
    }

    public static Login asAdmin() {
        return instrumented(Login.class, "[email protected]", "AdminPass123");
    }

    public static Login asUser() {
        return instrumented(Login.class, "[email protected]", "UserPass123");
    }

    @Override
    @Step("{0} logs in with email #email")
    public <T extends Actor> void performAs(T actor) {
        actor.attemptsTo(
            Enter.theValue(email).into(LoginPage.EMAIL_INPUT),
            Enter.theValue(password).into(LoginPage.PASSWORD_INPUT),
            Click.on(LoginPage.LOGIN_BUTTON)
        );
    }
}

// src/test/java/screenplay/tasks/NavigateTo.java
package screenplay.tasks;

import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Open;
import net.thucydides.core.annotations.Step;
import screenplay.ui.LoginPage;

import static net.serenitybdd.screenplay.Tasks.instrumented;

public class Navig
Полный SKILL.md на GitHub

Установить Serenity BDD Testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Serenity BDD Testing?

Java BDD testing with Serenity BDD framework using the Screenplay pattern, Cucumber integration, step libraries, comprehensive reporting, and living documentation generation.

Как установить скилл Serenity BDD Testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Serenity BDD Testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Serenity BDD Testing с