allure-framework / allure-python

Allure integrations for Python test frameworks
https://allurereport.org/
Apache License 2.0
718 stars 237 forks source link

Add processing of "epic" and "story" tags for behave tests #693

Closed Alpherie closed 1 year ago

Alpherie commented 1 year ago

I'm submitting a ...

What is the current behavior?

Behave tests on "Behaviors" tab are grouped only by feature.

What is the expected behavior?

Tags like "@epic=myepic1" and "@story=mystory1" for tests and features should initiate grouping of tests as epics and stories on "Behaviors" tab, 3 levels instead of one.

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

Subcategories will be very neat when having a lot of tests.

skhomuti commented 1 year ago

Hey @Alpherie! You can use allure labels to specify your epic or story, like:

@allure.label.epic=MyEpic
@allure.label.story=MyStory

These labels would be used in Behaviours tab as you expected

is it suitable for you?

Alpherie commented 1 year ago

@skhomuti Thank you, it works, I was just unable to find it in docs. Btw, are there any ways to use strings with spaces as epic and story names?

skhomuti commented 1 year ago

@Alpherie Im not sure how it doing with behave tag syntax but it works with hooks

def before_feature(context, feature):
    feature.tags.append("allure.label.epic=Epic with spaces")

And yes, I think I'll add more behave examples

Alpherie commented 1 year ago

@skhomuti Thank you. Closing issue.