allure-framework / allure-python

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

Path to feature file in allure report #544

Open rayjlinden opened 3 years ago

rayjlinden commented 3 years ago

[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )

I'm submitting a ...

What is the current behavior?

I have tests in many directories (many repos, in fact). All get run together for a report we gen in Allure. The report shows the feature name. However, there seems to be no way to display the path to the feature file. Because the tests are in lots of dirs - it is then rather painful to find the right file.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Would love for the plugin to also set the path to feature file in the allure report.

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

Ease of use for developers and QA folks.

Please tell us about your environment:

Other information

[//]: # ( . e.g. detailed explanation, stacktraces, related issues, suggestions . how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc )

sseliverstov commented 3 years ago

@rayjlinden as a workaround you can add this hook implementation

import allure

def after_scenario(context, scenario):
    uri = "https://github.com/allure-framework/allure-python/tree/master/allure-behave/{filename}".format(filename=scenario.filename)
    allure.attach(uri, name="test location", attachment_type=allure.attachment_type.URI_LIST)
sseliverstov commented 3 years ago

@rayjlinden but the best solution is to provide suite labels for behave reports. So please do not close this issue

asyncmind0 commented 2 years ago

I don't think the workaround works anymore. image