allure-framework / allure-python

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

Add ability to add parametr to name of paramerised test case #770

Open KatrinTor opened 1 year ago

KatrinTor commented 1 year ago

Hello.

I'm submitting a ...

It would be great to have ability to add parameter to name of parameterized test case.

What is the current behavior?

If I have a huge number of parameters in my test case it becomes tricky to find righr one in allure report. image

@allure.title('TEST')
@pytest.mark.parametrize('browser_manager', [param1, param2, param3, param4, param5, param6], indirect=True)
def test():
 with allure.step('1'):
 pass
with allure.step('2'):
pass

What is the expected behavior?

It would be great to have ability to add parameter to name of parameterized test case. test

Please tell us about your environment:

joaonc commented 1 year ago

Seems related to https://github.com/allure-framework/allure-python/issues/341

Allure guys: a this is a feature in demand! Doesn't seem that hard to fix/implement either.

codymallonee commented 1 month ago

Any chance replacement could be provided for @allure.testcase as part of this? The following approach works great with @allure.title, but results in an unusable URL in the report.

TEST_DATA = [
    pytest.param("MyUsername", "myPassword", "https://testrepo.com/repositories/6?case_id=283589"),
    pytest.param("MyUsername", "InvalidPassword", "https://testrepo.com/repositories/6?case_id=283590"),
]

...
    @pytest.mark.parametrize("username, password, test_case_url", TEST_DATA)
    @allure.testcase(url="{test_case_url}", name="MyTestRepo")
    def test_general_login(