Tutorial: Learn Allure Framework from Scratch (2026)
I used to dread reading test reports — endless tables of pass/fail counts with no context about what went wrong. Allure Framework transformed test reporting into a rich, interactive web dashboard that tells a story about your test execution. It turns raw test results into a visual narrative with attachments, steps, and trends.
Allure is a flexible, multi-language test reporting tool. It supports Java, Python, JavaScript, Ruby, Kotlin, and PHP. It integrates with every major test framework — JUnit, TestNG, Cucumber, pytest, Mocha, and more. This tutorial covers annotations, steps, attachments, and CI integration.
Setting Up Allure and Generating Your First Report
Allure consists of adapters that attach to your test framework and a command-line tool that generates the report. Add the allure dependency for your test framework. For JUnit 5, use allure-junit5. Run your tests normally — the adapter collects information into an allure-results directory.
After test execution, run allure generate to create the HTML report and allure open to view it. The report shows the test suite overview, each test with its steps, parameters, attachments, and duration. The dashboard includes graphs for test status distribution, duration trends, and severity breakdown.
io.qameta.allure
allure-junit5
2.27.0
# Generate and view report
download allure commandline
allure generate allure-results --clean
allure open allure-report
Allure Annotations for Rich Descriptions
Allure annotations enrich your tests with metadata. @DisplayName sets the human-readable test name. @Description adds a detailed explanation. @Severity categorizes tests as blocker, critical, normal, minor, or trivial. @Link associates tests with requirements or issues.
Use @Epic, @Feature, and @Story to organize tests in a hierarchy that mirrors your feature tree. @Owner identifies the test author. @Tag adds custom labels. The annotation processor writes this metadata to the allure-results files, and the report renders it in a navigable tree structure.
@Epic("User Management")
@Feature("Authentication")
@Story("User Login")
@Severity(SeverityLevel.CRITICAL)
@DisplayName("Successful login with valid credentials")
@Description("Verify that a user can log in with correct email and password")
@Link(name = "JIRA-123", url = "https://jira.example.com/browse/JIRA-123")
@Test
void shouldLoginSuccessfully() {
// test implementation
}
Steps and Nested Steps
Steps break down a test into granular actions, making failures easy to diagnose. Use @Step on methods to include them in the report. The step name appears in the report tree, and its parameters are captured automatically. Nested steps create a hierarchy of actions.
I annotate every logical action in my tests as a @Step. When a step fails, Allure shows exactly which action failed without digging through logs. Step parameters are displayed in the report, making it clear what data was used at each stage of the test.
@Step("Login as user {email}")
public void login(String email, String password) {
loginPage.enterEmail(email);
loginPage.enterPassword(password);
loginPage.clickLogin();
}
@Step("Verify dashboard displays user name {expectedName}")
public void verifyDashboardUserName(String expectedName) {
String actualName = dashboardPage.getUserName();
assertEquals(expectedName, actualName);
}
Attachments for Debugging
Attachments add context to test results — screenshots, logs, HAR files, or any text content. Use Allure.addAttachment() with a name and content. For screenshots, capture the browser state when a test fails and attach it as a PNG image.
I attach screenshots automatically in a @AfterEach hook when a test fails. Network HAR files are attached for API-related failures. Database states are captured as JSON. These attachments transform a cryptic failure into a solvable problem with all the evidence at your fingertips.
@Attachment(value = "Page screenshot", type = "image/png")
public byte[] captureScreenshot() {
return ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
}
@Attachment(value = "Response body", type = "application/json")
public String attachResponse(String response) {
return response;
}
Parameterized Tests with Allure
Allure handles parameterized tests natively. Each parameter set appears as a separate test case in the report with the parameter values visible. Use @ParameterizedTest with @CsvSource, @MethodSource, or @ValueSource as usual — Allure captures the parameters automatically.
Custom parameter names make the report more readable. Use @ParameterizedTest(name = "Test with input: {0}") to control how each iteration is named. In the report, you see each data set individually, making it easy to identify which combination caused a failure.
@ParameterizedTest(name = "Login with {0} should return {2}")
@CsvSource({
"user1, pass1, success",
"user2, wrong_password, invalid_credentials",
", pass1, missing_username"
})
void shouldValidateLogin(String username, String password, String expectedStatus) {
LoginResponse response = loginService.login(username, password);
assertEquals(expectedStatus, response.getStatus());
}
Allure in CI and Trend Analysis
Allure integrates with CI tools through the command-line report generation. Jenkins has an Allure plugin that automatically collects results and displays the report. GitHub Actions can use the simpleallure-report action to publish reports to GitHub Pages.
Historical data enables trend analysis. Allure stores previous results and shows how test duration and pass rates evolve over time. A sudden spike in duration or new failures becomes immediately visible on the trend graph. I check the Allure trend chart after every CI run to catch regressions early.
# Jenkins Allure plugin runs this automatically
allure generate allure-results --clean -o allure-report
# GitHub Actions
- name: Generate Allure Report
run: |
npm install -g allure-commandline
allure generate allure-results --clean
allure upload allure-results
Frequently Asked Questions
Is Allure free and open-source?
Yes, Allure Framework is open-source under the Apache 2.0 license. The test adapters and report generation are free. Allure TestOps, a commercial product, adds test management and analytics.
Can Allure integrate with Cucumber?
Yes, Allure has a dedicated adapter for Cucumber JVM. Feature file scenarios and steps appear directly in the Allure report with Gherkin keywords preserved. This bridges BDD and reporting seamlessly.
How do I customize the Allure report look and feel?
Allure supports custom CSS and JavaScript injected into the report. You can add your company logo, change the color scheme, and customize the dashboard widgets through the plugins mechanism.
What is the difference between Allure and ExtentReports?
Allure is more focused on structured reporting with annotations, steps, and attachments. ExtentReports is simpler and generates reports without a CLI tool. Allure supports cross-language projects; ExtentReports is primarily Java.
Originally published on Ayodhyyya. Last updated June 1, 2026.