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

[feature requests]is there any way to add allure mark for priority and owner, show in reports and filter

Open stevenxuwoss opened this issue 4 years ago • 3 comments

is there any way to add allure mark for priority and owner, show in reports and filter?

stevenxuwoss avatar Oct 02 '21 11:10 stevenxuwoss

Is custom labels what are you looking for? https://github.com/allure-framework/allure-python/blob/master/allure-pytest/examples/label/custom/custom_label.rst

rad96 avatar Oct 15 '21 13:10 rad96

@rad96 could you give more example for it? if add a lable like @allure.label("owner", "andy") how to run with it like pytest --allure-epics=epic? --allure-owner=andy? any it will show in the allure report??

stevenxuwoss avatar Oct 21 '21 02:10 stevenxuwoss

@rad96 could you give more example for it? if add a lable like @allure.label("owner", "andy") how to run with it like pytest --allure-epics=epic? --allure-owner=andy? any it will show in the allure report??

I don't think it's possible currently But you can make it yourself in plugin.py

rad96 avatar Oct 21 '21 09:10 rad96

You can use pytest marks - they are automatically converted into tag labels, which are visible in the report (other labels are not):

import pytest

@pytest.mark.owner("John Doe")
def test_owner_is_john_doe():
    pass

image

You can also implement mark-based filter by your own, see here.

Once the label-based test selection is implemented (see #725), it will be possible to filter tests like this (the syntax may change):

pytest --allure-label "TAG=owner('John Doe')" ...

I'm closing this issue, since we have a dedicated one for label-based filtering (and as I see, there is nothing else in scope of allure-pytest to implement here). If you have any suggestion on how tests should be displayed in the report, please, start an issue in allure2 repository. If you need help, you can start a discussion or use stackoverflow.

delatrie avatar Jan 23 '23 07:01 delatrie