allure-framework / allure-python

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

parametrized test in allure testops in different cases #767

Closed SergyBud closed 11 months ago

SergyBud commented 11 months ago

(

There are parameterized tests, each of which has its own identifier in TestOps. I need them to appear in TestOps each under their own ID. How can I decorate tests, what decorator methods should I use so that the tests are separated when uploaded to TestOps There is code in Java on how to do this, but I haven’t found an analogue in Python )

What is the current behavior?

My one parametrized test after testing will upload in testops in different cases

Please tell us about your environment:

Other information

[//]: # ( Снимок экрана 2023-09-21 в 13 16 52

)

delatrie commented 11 months ago

Hi, @SergyBud !

Try allure.dynamic.id:

import allure
import pytest

@pytest.mark.parametrize(["allureId", "type"], [
    ("37898", "GitHub"),
    ("37899", "Azure"),
    ("37897", "Google")
])
def test_all_auths(allureId, type):
    allure.dynamic.id(allureId)

FTR: the discussions page is a better place for such kind of questions.