reportportal / agent-python-pytest

Framework integration with PyTest
Apache License 2.0
94 stars 102 forks source link

How can I link test case id (from JIRA) to the reportportal? #297

Closed zaneta500200 closed 2 years ago

zaneta500200 commented 2 years ago

Hi, I'd like to link test case id (from Jira) to test executions in reportportal but I can't find any info how to do it. I tested rp_issue_id_marks but this is more suitable for bugs than test cases. Thanks in advance!

iivanou commented 2 years ago

@zaneta500200 You can wrap your test function with @pytest.mark.tc_id('test_case') for example, and you will see tc_id:test_case among test tags to the test at the RP UI.

zaneta500200 commented 2 years ago

@iivanou thanks for quick response - I figured out the tag but it would be much more convenient to have it linked in the same way as bugs (issue egd-1234 on the print screen Zrzut ekranu 2022-02-04 114259 )

iivanou commented 2 years ago

@pytest.mark.tc_id(" [{tc_id}]({url})".format(tc_id, url))

alphoense commented 2 years ago

@iivanou hi, I'm working with @zaneta500200 on this problem.

Injecting such markup [name](url) works though for description but not for tags. ( We've tried to implement your suggestion with few modification, but everything we've got was plain url in tag on test (if solution was working) We were trying to insert a html link as well, but so far all characters were escaped correctly from backed side on reportportal. and listed as a non-formatted text.

Our goal is to get such view: image this was modified on html page of the existing report.

Any other suggestion/tip that we can follow?

iivanou commented 2 years ago

We can implement passing test_case_id to the common client. The information about ID will be displayed the following way: image Are u ok with that? The is no way to do it like for issues.

HardNorth commented 2 years ago

Implemented in: https://github.com/reportportal/agent-python-pytest/tree/5.1