Allure Dependency and Annotations
Explore how to configure Allure dependencies in Gradle and Maven projects for test automation. Learn to apply key Allure annotations like @Step and @Attachment to document test execution steps and attach test artifacts, enabling better reporting and test lifecycle tracking.
We'll cover the following...
We'll cover the following...
Adding dependency
To use Gradle, we have to add the dependencies below to our project’s build file:
Gradle (in build.gradle)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.qameta.allure:allure-gradle:2.8.1"
}
}
plugins {
id 'io.qameta.allure'
}
allure {
version = '2.13.1'
autoconfigure = true
aspectjweaver = true
clean = true
allureJavaVersion = "${allure.version}"
resultsDir = file('test-output/allure-results')
reportDir = file('test-output/allure-reports')
downloadLink = "https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${allure.version}/allure-commandline-${allure.version}.zip"
}
Opening Allure report
To open the Allure report after test execution using Gradle, we can use the following command:
./gradlew allureServe
Maven (in pom.xml)
<properties>
<aspectj.version>1.9.5</aspectj.version>
</properties>
<dep ...