Problem with generating allure report with cucumber and junit5

51 views Asked by At

Based on site https://allurereport.org/docs/cucumberjvm/ I tried to configure allure reports to project with junit5 and cucumber. Unfortunatelly report is not beeing generated. Other reports (cucumber, junit) works correctly and are present.

This is my build.gradle.kts file:

plugins {
    id("java")
    id("io.qameta.allure") version "2.11.2"
}

apply(plugin = "io.qameta.allure")

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

val allureVersion = "2.24.0"
val aspectJVersion = "1.9.22"

val agent: Configuration by configurations.creating {
    isCanBeConsumed = true
    isCanBeResolved = true
}

dependencies {
    agent("org.aspectj:aspectjweaver:${aspectJVersion}")

    testImplementation(platform("org.junit:junit-bom:5.10.2"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.2")

    testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
    testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.2")
    testImplementation("org.junit.platform:junit-platform-suite:1.10.2")

    testImplementation("org.slf4j:slf4j-api:2.0.9")
    testImplementation("ch.qos.logback:logback-classic:1.5.3")

    testImplementation("org.assertj:assertj-core:3.25.3")
    
    testImplementation("io.cucumber:cucumber-junit-platform-engine:7.16.1")
    testImplementation("io.cucumber:cucumber-java:7.16.1")

    testImplementation("org.apache.commons:commons-collections4:4.4")

    testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
    testImplementation("io.qameta.allure:allure-cucumber7-jvm")
    testImplementation("io.qameta.allure:allure-junit-platform")
    
}

tasks.test {
    useJUnitPlatform()
    jvmArgs = listOf(
            "-javaagent:${agent.singleFile}"
    )
}


I have also in

/src/test/resources/

allure.properties file with:

allure.results.directory=build/allure-results

I installed also:

npm install --save-dev allure-commandline

in project root directory .

At the end after executing command:

./gradlew clean build test

in intellij under windows

cucumber.html file is created but not allure report. In directory

build\allure-results

only 2 files appears:

a437a757-9ea3-4eba-a064-12069f40c081-container.json
executor.json

Am I doing something incorrectly? Everything looks good.

Edit:

I tried to run exemplary solution ( https://github.com/allure-examples/allure-cucumber7-junit-platform-gradle-kts ) but it also ends without html file report in directory build/allure-results , only few json files are created in this directory.

Edit:

It is possible to see result but results file have to be copied into directory:

allure-results

in a root directory.

After that report has to be generated, eg.:

npx allure-commandline serve

command has to be executed in root directory.

Final list of dependencies looks like:

val allureVersion = "2.26.0"
val aspectJVersion = "1.9.22"

dependencies {
    agent("org.aspectj:aspectjweaver:${aspectJVersion}")

    testImplementation(platform("org.junit:junit-bom:5.10.2"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    testImplementation("org.slf4j:slf4j-api:2.0.9")
    testImplementation("ch.qos.logback:logback-classic:1.5.3")
    testImplementation("org.assertj:assertj-core:3.25.3")
    testImplementation("io.cucumber:cucumber-junit-platform-engine:7.16.1")
    testImplementation("io.cucumber:cucumber-java:7.16.1")
    testImplementation("org.junit.platform:junit-platform-suite:1.10.2")
    testImplementation("org.apache.commons:commons-collections4:4.4")
    testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
    testImplementation("io.qameta.allure:allure-cucumber7-jvm")
    testImplementation("io.qameta.allure:allure-junit-platform")
    testImplementation("io.qameta.allure:allure-junit5")

}
0

There are 0 answers