pytest-dev / pytest-html

Plugin for generating HTML reports for pytest results
Other
690 stars 234 forks source link

[Request]: Can we please add the support to extend the pytest-html to pytest-bdd framework? #295

Open CuriousQA opened 4 years ago

CuriousQA commented 4 years ago

This plugin is absolutely working for pytest-bdd framework too. I see the passed/failed/skipped etc. However, I am wondering if we can extend support of this plugin for pytest-bdd framework? As we can see the report with the Feature as well for Feature/Gherkin steps. ?? Any suggestions/thoughts are highly appreciated.

christiansandberg commented 4 years ago

Just for information, I've just started developing a plugin to generate reports using templates and hooks. This would be a typical use case where you have specific needs that would make pytest-html more bloated if it should try to support every specific need. It has a core plugin which can be used by other plugins to offer various templates. It's very experimental and lacks basic features but I hope I'll have an alpha version ready soon.

You might also want to check out Allure that I think has support for pytest-bdd.

CuriousQA commented 4 years ago

Thank you @christiansandberg for the response. Good to know there is an active development and I'm hopeful that you will be succeeded.

My main purpose for this report is to get a single html file, which has the necessary details. This HTML email will be sent to the team via Jenkins. The receivers can just view the report on the high level. Most of the receivers do not have access to view the report in Jenkins. As to send an email is the main reason, the Allure report doesnt work for me. Thank you for the suggestion though.

christiansandberg commented 4 years ago

The reference template I’m developing is a self contained HTML file. Although Allure looks cool it is not always very practical to have to send a huge zip file or host it on a server.

CuriousQA commented 4 years ago

Good to know.. I am not new but kinda in Python. If you need any assistance in few modules, I can try to help you out.

CuriousQA commented 4 years ago

Just for information, I've just started developing a plugin to generate reports using templates and hooks. This would be a typical use case where you have specific needs that would make pytest-html more bloated if it should try to support every specific need. It has a core plugin which can be used by other plugins to offer various templates. It's very experimental and lacks basic features but I hope I'll have an alpha version ready soon.

You might also want to check out Allure that I think has support for pytest-bdd.

Hey @christiansandberg , just want to check in with you how is it going along with the report enhancement?

christiansandberg commented 4 years ago

It's ready for use at https://github.com/christiansandberg/pytest-reporter. The idea is that you don't need to write a lot of Python code or get too much involved in Pytest internals but focus more on the content of the report. If you want make a HTML report you obviously need knowledge of that. In your case you also need to complement with information provided by pytest-bdd. I'm not that used to BDD so it's better if someone else writes a report template for that, but I can try to help.