Create new annotation in Allure report, e.g. @Release with priority higher than @Feature

1.8k views Asked by At

How to create new annotation in Allure report, e.g. @Release with priority higher than @Feature. Or @SubFeature that would be displayed inside @Feature but above @Story in the report?

It is fairly easy to create new annotation as in ru.yandex.qatools.allure.annotations package, the challenge is how to make Allure read them and display in the report properly.

I am using Java/TestNG framework.

Any suggestions welcome !!!

2

There are 2 answers

0
Serhii Korol On

If you've already migrated to Allure 2, you may want to check official docs - plugins system section. It's a good way to start with any customization.

1
Dmitry Baev On

Allure 2 has support for up to 3 levels of grouping for Behaviors tab (Epic -> Feature -> Story). So you can simply use @Epic annotation as a first level group. The following test

import io.qameta.allure.Epic;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;

@Epic("Allure 2 Features")
@Feature("Support for BDD annotations")
@Story("Epic annotation support")
void shouldSupportEpicAnnotations() {
    //do something
}

will be displayed in the report like this:

enter image description here