allure-framework / allure-java

Allure integrations for Java test frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate scenario in Allure report

IlyasPatel opened this issue · comments

Here is a sample project which replicates the issue, duplicate scenario names appear in the final Allure report:

https://github.com/IlyasPatel/stackoverflow-gradle-cucumber-allure

The Allure_Report_Duplicate.png displays the problem.

It started to happen when I added 'io.qameta.allure:allure-junit4:2.8.1' dependency. When I remove this, I don't get duplicates but I do get a NullPointerException and the build fails.

Actually, the main problem of NPE is because allure-gradle is not working correctly with cucumber-jvm. Here is the fix submitted allure-framework/allure-gradle#28

The workaround now is disable autoconfigure feature for Allure Gradle plugin. The correct configuration is:

allure {
    autoconfigure = false
    aspectjweaver = true
    version = '2.8.1'
    downloadLink = 'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip'
}

dependencies {
    compile 'io.cucumber:cucumber-java:3.0.2'
    compile 'io.cucumber:cucumber-junit:3.0.2'
    compile 'io.qameta.allure:allure-cucumber3-jvm:2.8.1'

}

NOTE:

  • autoconfigure = false is needed to prevent NPE
  • aspectjweaver = true to enable support of @Step and @Attachment annotations
  • version = '2.8.1' - latest Allure version
  • downloadLink is needed because latest version of Allure available only in maven central, but Allure Gradle is not updated yet.