allure-java icon indicating copy to clipboard operation
allure-java copied to clipboard

🐞: [JUnit5] Suite view displays both the suite and the package of the test, duplicating the test

Open harmin-parra opened this issue 1 year ago • 2 comments

What happened?

I don't understand why #1004 was rejected.

in my test I have :

public class LabelsTest {

    @Test
    public void method_name() {
    	Allure.epic("Epic");
    	Allure.story("Story");
    	Allure.suite("Suite");
    	Allure.feature("Feature");
    }

}

Test Allure displays both the suite and the package in the Suite view

image

If I set the Allure Suite metadata, why is the report also including the package and showing a duplicate of the test ?

What Allure Integration are you using?

allure-junit5

What version of Allure Integration you are using?

2.26.0

What version of Allure Report you are using?

2.27.0

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

harmin-parra avatar Apr 05 '24 13:04 harmin-parra

Allure JUnit5 sets the "suite" label for each test automatically. If you want to override it, you need to remove it from the result first:

Allure.getLifecycle().updateTestCase(tr -> tr.getLabels().removeIf(label -> "suite".eq(label.getName())));
Allure.suite("Suite");

baev avatar Apr 05 '24 14:04 baev