Skip to content

Ability to rename classes with TestNG #438

Description

@sokecze

I'm submitting a ...

  • bug report
  • [*] feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Allure groups suites into sub-suites, which, in case of TestNG, are full class names (with their packages).

What is the expected behavior?

As far as I understand, Allure has an ability to use custom class names with JUnit. In JUnit, classes can be renamed with @DisplayName annotation. In TestNG, there's no such annotation, thus, I'd like to have something like Allure's @Description annotation be applicable to class names. For example,

@Description("Class Name Without Package")
public class TestClass

What is the motivation / use case for changing the behavior?

Some projects have very long package names, which are redundant for reports.

Please tell us about your environment:

Allure version 2.8.1
Test framework testng@6.8
Allure integration allure-testng@2.13.2
Generate report using allure-maven@2.10.0

Other information

Screen Shot 2020-04-14 at 11 37 01

Activity

  1. kathyrollo commented on Apr 21, 2020

    @kathyrollo

    I would think the JUnit 5 adapter is more up to date. JUnit 5 is a good turning point to move away from TestNG now.

  2. sokecze commented on Apr 21, 2020

    @sokecze
    Author

    I would think the JUnit 5 adapter is more up to date. JUnit 5 is a good turning point to move away from TestNG now.

    @kathyrollo unfortunately, JUnit 5 suites are not as flexible as in TestNG. The way suites organized in TestNG are more convenient, I think. I'd prefer to stay with TestNG with an ability to rename test classes

  3. kathyrollo commented on Apr 24, 2020

    @kathyrollo

    Used TestNG for the past 3 years, I opted with simply tagging my tests correctly and passing the tags via cmdline to the maven-surefire-plugin (see "Filtering by Tags"), also more flexible for CI/CD . Removing the testng.xml was 1 less file to maintain since my switch to JUnit 5 and was rather refreshing and lightweight. They also have versatile annotations for naming tests which Allure already supports natively (see here).

    Nonetheless, I understand if you would still prefer to proceed with TestNG, just thought I would share the modern flexibility of JUnit 5. It may be more apt to request this feature with TestNG instead.

    Good luck!

  4. kathyrollo commented on Apr 25, 2020

    @kathyrollo

    I was going over the Allure docs, it seems Allure already supports this for TestNG. You have to use the description property of the @Test annotation.

    https://docs.qameta.io/allure/#_displayname_3

  5. sokecze commented on May 1, 2020

    @sokecze
    Author

    @kathyrollo this doesn't work and throws
    [main] ERROR io.qameta.allure.AllureLifecycle - Could not update test fixture: test fixture with uuid 3c4f2e98-e994-477e-b58f-26215de9e0ab not found
    [main] ERROR io.qameta.allure.AllureLifecycle - Could not stop test fixture: test fixture with uuid 3c4f2e98-e994-477e-b58f-26215de9e0ab not found

  6. added theissue type on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions