Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
harmin-parra opened this issue Apr 5, 2024 · 2 comments
Labels
triage type:bug Something isn't working

Comments

@harmin-parra
Copy link

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

  • I agree to follow this project's Code of Conduct
@harmin-parra harmin-parra added triage type:bug Something isn't working labels Apr 5, 2024
@baev
Copy link
Member

baev commented Apr 5, 2024

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");

@cHenrique0
Copy link

cHenrique0 commented Oct 8, 2024

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");

This worked for me. Thanks, @baev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants