Skip to main content

How Allure is integrated

Allure is wired into the project through two components defined in pom.xml: allure-cucumber7-jvm dependency — a Cucumber listener that converts each step execution into an Allure result file:
pom.xml
<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-cucumber7-jvm</artifactId>
    <version>${allure.version}</version>   <!-- 2.27.0 -->
    <scope>test</scope>
</dependency>
AspectJ weaver agent — required for Allure’s @Step and @Attachment annotations to work at runtime under Java 21. It is passed as a -javaagent argument to the JVM via maven-surefire-plugin:
pom.xml
<argLine>
    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/
    ${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
The listener is registered in TestRunner.java as a Cucumber plugin:
runners/TestRunner.java
plugin = {
    "pretty",
    "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"
}

Where results are stored

After mvn test, raw JSON result files are written to:
target/allure-results/
This path is configured in maven-surefire-plugin:
pom.xml
<systemPropertyVariables>
    <allure.results.directory>
        ${project.build.directory}/allure-results
    </allure.results.directory>
</systemPropertyVariables>
target/allure-results/ contains raw data only — not a viewable report. You need to generate the HTML report from these files using one of the methods below.

Generating and viewing reports

The project includes the allure-maven plugin (version 2.12.0). Use it to generate a static HTML report or launch a local server.Generate a static report (written to target/site/allure-maven-plugin/):
mvn allure:report
Serve a live report (opens automatically in your browser):
mvn allure:serve
allure:serve generates the report and starts a temporary HTTP server. The browser opens automatically. Press Ctrl+C to stop the server.

What the report includes

The Allure HTML report surfaces all of the information collected by the AllureCucumber7Jvm listener:
SectionWhat you see
OverviewTotal pass/fail/skip counts and a trend chart across runs
BehaviorsScenarios grouped by Feature and Scenario name, mirroring your Gherkin structure
Step detailsEach @Given/@When/@And/@Then step with pass/fail status and elapsed time
TimelineA chronological view of all scenario executions
CategoriesFailed tests grouped by failure type (product defect, test defect, etc.)
The Behaviors tab is the most useful for BDD projects — it lists your feature files and scenarios exactly as written in Gherkin, making it easy to share with non-technical stakeholders.

Typical workflow

1

Run the tests

mvn test
This compiles, runs the scenarios, and writes raw results to target/allure-results/.
2

Open the report

mvn allure:serve
The report opens in your default browser automatically.
3

Review results

Navigate to the Behaviors tab to see each scenario’s step-by-step result. Failed steps are highlighted in red with the assertion error message.

allure.properties configuration

You can add an allure.properties file to src/test/resources/ to customise Allure behaviour:
src/test/resources/allure.properties
# Custom output directory (default is target/allure-results)
allure.results.directory=target/allure-results

# Optional: link issue tracker tickets in reports
allure.link.issue.pattern=https://github.com/NoMeCompila/RIU-Web-App-Automation/issues/{}

# Optional: link test management system
allure.link.tms.pattern=https://your-tms.example.com/testcase/{}
If both allure.properties and the systemPropertyVariables in pom.xml define allure.results.directory, the system property from pom.xml takes precedence at runtime.
Do not commit the target/ directory to version control. Add it to .gitignore to keep generated reports out of your repository.

Build docs developers (and LLMs) love