Skip to content

Latest commit

 

History

History
84 lines (75 loc) · 2.8 KB

README.md

File metadata and controls

84 lines (75 loc) · 2.8 KB

Report Portal Allure integration for Cucumber framework

Installation

The Agent follows the same idea as our original Spock agent. To start working with Allure features you need to include our agent into your dependencies.

Gradle

dependencies {
  testImplementation 'com.epam.reportportal:agent-allure-spock:5.2.1'
}

Maven

<dependency>
    <groupId>com.epam.reportportal</groupId>
    <artifactId>agent-allure-spock</artifactId>
    <version>5.2.1</version>
    <scope>test</scope>
</dependency>

Property configuration file

To start using Report Portal you need to create a file named reportportal.properties in your Java project in a source folder src/main/resources or src/test/resources (depending on where your tests are located):

reportportal.properties

rp.endpoint = http://localhost:8080
rp.uuid = e0e541d8-b1cd-426a-ae18-b771173c545a
rp.launch = Spock Tests
rp.project = default_personal

Property description

  • rp.endpoint - the URL for the report portal server (actual link).
  • rp.api.key - an access token for Report Portal which is used for user identification. It can be found on your report portal user profile page.
  • rp.project - a project ID on which the agent will report test launches. Must be set to one of your assigned projects.
  • rp.launch - a user-selected identifier of test launches.

These are basic properties for comprehensive list of parameters please look into client-java repository.

AspectJ configuration

If you don't have Allure configured yet and to be able to use all Agent features you also need to include AspectJ Java agent (usually it's already done in scope of Allure configuration).

Gradle

test {
    doFirst {
        def weaver = configurations.testRuntimeClasspath.find { it.name.contains("aspectjweaver") }
        jvmArgs += "-javaagent:$weaver"
    }
}

Maven

You need to update your surefire plugin configuration (find existing not creating new) as here:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.2</version>
    <configuration>
        <argLine>
            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar"
        </argLine>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.9.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit-platform</artifactId>
            <version>2.22.2</version>
        </dependency>
    </dependencies>
</plugin>