Comments (38)
+1
from behave.
Guys, we just released beta version of allure behave formatter. It is already can build report over behave self-tests (v1.2.5). Welcome to taste it https://pypi.python.org/pypi/allure-behave/
from behave.
@bittner : can we add logs and steps in this report as well ?
from behave.
Can we attach screenshots of failure cases in behave-html-formatter report ?
Have you tried?
The formatter can handle videos, images, text and links as embedded objects.
Please verify yourself whether the feature works for you as expected. If not, go to the repository and open an issue or submit a PR to improve the formatter implementation.
from behave.
Hey, what about that pull request? People want HTML!
Please let me know if I can help to make this quicker.
from behave.
Interesting ! I wrote something similar: https://gist.github.com/Lucas-C/2ba14f253186e8df079219a3038e7d94
But ideally it should be included in behave
from behave.
@kaskelotti True. Developing such thing requires much more work than just reformatting json files, but maybe some JS ninja can take up the glove and develop such script.
Anyway as it said in previous comments, behave developers/contributors should consider implementing it as part of the library --format options.
from behave.
I vote for this too - really need HTML output so I can publish results in Jenkins. The JUnit output only shows failures and doesn't show the text of the steps that fail. Currently outputting to text file and including in documentation generated by Sphinx but a bit clunky.
from behave.
@s1ider this PR needs some improvements:
- Add tests (this is not easy as HTML report includes CSS)
- Response from users - HTML report works for me, but may crash for others
from behave.
I would say it's easier to write json/xml output and use http://allure.qatools.ru/ to generate html (which is pretty nice anyway).
from behave.
I feel like this is more "forum" conversation..
I used the html report that vrutkovs made and it looks good, but I really like what the Allure reports has to offer. Are you actually using Allure to generate report from the junit output from behave?
from behave.
Allure reports look nice, though its not a replacement - some reports should be kept internally. Some SUTs might not be upload info at all.
A better idea would be writing an Allure formatter for Behave and/or syncing json schemas with Cucumber.
from behave.
@tomatobrown
Allure looks nice, but I am not using it yet.
Support for allure would either be an own formatter or a post-processing tool based on XML/JSON output (or both). Feel free to provide one either as pull-request or as own behave extension (own project).
Other allure-adapters, like for pytest or allure-cucumber may be a start.
An example project to the test the functionality would be nice, too.
Therefore, I have much the same opinion as Vadim (@vrutkovs).
NOTES:
There is a feature requesting pending (#120) to simplify the extension of behave w/ formatters, etc.
As a quick solution, we may support "--format=my.formatter_module::MyFormatterClass" on behave command line (or in the configuration file).
If you provide a pull-request, please avoid to use lxml
(and I am a big fan of lxml
). This is not required when writing/generating XML and I want to avoid the python extension module (if there is no compelling reason).
P.S.: @vrutkovs
Your pull-request is still pending in my queue (sorry, I know …).
from behave.
Thanks all for your efforts! By chance is the html report generation for behave working? I really need it.
from behave.
+1
from behave.
Great idea, and awesome work so far !
Please go on :)
from behave.
Hi guys!
I've written a little package which can help some of you guys ( It did helped me).
This package formats the behave json to cucumber json. Then you can use the new generated cucumber json to use on any plugins available for cucumber to generate prettier reports. (I've used it with Cucumber-JVM Reporter)
The package can be found here: Behave to Cucumber formatter
Hope this will help to some of you, good luck!
from behave.
True! I think it is really a good time for them to implement it, there is so many python user's and BDD getting so popular lately due to automation teams development around the globe.
from behave.
Hmmm... We have a JSON formatted output already, couldn't that be used to geneate HTML report by some templating?
from behave.
@kaskelotti Check this mate: https://www.npmjs.com/package/cucumber-html-report
from behave.
@andreybehalf thanks. If I understood correctly, using the tool requires one to first convert the behave json report to a cucumber one. Why not simply create mustache templates for behave directly?
from behave.
@sseliverstov Man that is really really cool, I actually managed to generate a report using your formatter and it worked perfectly.
I do missing one thing and you might help me with that - context params - is there a way to pass the context params of a behave scenario to the allure report?
For an example - I have a test that verifies customer can login to my site - what I want is the info of the customer will be presented in the allure report.
(In cucumber report I would use stdout to print this params and had access to them inside the exception window.)
Thanks!
from behave.
Now it is possible, just make attachment in hook. Also you can attach your data form any step. Enjoy;)
from behave.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Comment to post when closing a stale issue. Set to false
to disable
from behave.
Wow, this has been hanging around for years.
from behave.
Still no update
from behave.
Any update on this please..
from behave.
Sorry for the long wait! The HTML formatter is now available under the @behave-contrib umbrella at https://github.com/behave-contrib/behave-html-formatter.
- Install it using pip, e.g.
python3 -m pip install behave-html-formatter
- Configure the formatter integration as described in the README, e.g.
[behave.formatters] html = behave_html_formatter:HTMLFormatter
- Use the
-f
/--format
option withbehave
, e.g.behave -f help behave -f html behave -f html -o behave-report.html
from behave.
Certainly! Please head over to behave-contrib/behave-html-formatter and open a PR with the changes you find useful. Or open an issue if you want to start slow.
from behave.
I want to add logs and steps which is showing in CLI in the report, as these displays in Extent report.
from behave.
Hi @bittner
Can we attach screenshots of failure cases in behave-html-formatter report ?
from behave.
@bittner : can we add logs and steps in this report as well ?
Sorry for the long wait! The HTML formatter is now available under the @behave-contrib umbrella at https://github.com/behave-contrib/behave-html-formatter.
1. Install it using pip, e.g. ``` python3 -m pip install behave-html-formatter ``` 2. Configure the formatter integration as described in the README, e.g. ```ini [behave.formatters] html = behave_html_formatter:HTMLFormatter ``` 3. Use the `-f`/`--format` option with `behave`, e.g. ``` behave -f help behave -f html behave -f html -o behave-report.html ```
Just like as, can we use html allure report formatter here as well and find attachment so that share to team ?
from behave.
@swatantra15081986 Please try it out whether it does what you want. We don't maintain allure-behave. You have to open issues on their issue tracker to clarify questions and report bugs. They also have a Gitter chat.
from behave.
@bittner : how can I go to there issue tracker ?
Anyway thanks for your solution which you provided regarding save behave html formatter.At least we can share report to team.
Now my next goal to :
- Add steps ( like print() and all) in html behave formatter report.
- add screenshot of failure step in report.
from behave.
how can I go to there issue tracker ?
https://github.com/allure-framework/allure-python/issues
from behave.
from behave.
@vishwas-tomar-telus @swatantra15081986 Listen, maybe there is a misunderstanding.
This is a free software project. And this is an issue tracker. Not a personal support forum. Sorry if I'm rude but maybe it helps to explain. As in all free software projects, you're invited to:
- Search the documentation for the topics you need help with. (We have extensive documentation; the table of contents covers a lot of popular topics.)
- Search the issue tracker, make sure this question hasn't been asked and answered before.
- Search the Internet. (You'll likely get a StackOverflow answer or a blog post on your topic.)
7 seconds
I invested 7 seconds to open up the docs, searched and found what you asked for. If you switch to the "latest" version (via the footer) you can also find content on yet unreleased features, such as the context.attach method on the json
formatter.
I will now stop to explain the behave-html-formatter addon. You're obviously not trying hard enough. It has all been explained, I'm afraid. Please try harder.
from behave.
@vishwas-tomar-telus :
Hi Viashwas,
Did you find the solution regarding : -
- How to add steps in behave html formatter report near scenario
- How to add screenshot of Fail case in html formatter.
Please help. I am new in automation and code and learnt behave framework with python by Udemy.
from behave.
Related Issues (20)
- Using Rich to write colored text to terminal from step definition not working HOT 1
- Jython 2.7 HOT 3
- Slack Reporter HOT 1
- Skip a .feature if background steps fail HOT 2
- "parse" dependency is missing a PyPI wheel, which may lead to errors in pip 23.1, coming soon HOT 1
- Command Line Option for Generation Python Template Code? HOT 2
- scenario_outline_annotation_schema cannot be specified on command line HOT 8
- What are the best practices to store the Behave report in Mongo DB? HOT 1
- ImportError: cannot import name 'given' from 'behave' HOT 2
- How to customize the title suffix of parameterized use cases? HOT 2
- How to use the variables defined in environment.py in the feature file? HOT 2
- How to loop through a feature? HOT 2
- mistake
- When I call 'json.dumps()' in 'step_implementation.py', the result for 'json.dumps()' showed in cucumber report is without double quote which should be there.. HOT 2
- Integrate diferent Directories with the same steps definition HOT 4
- all feature executed with arg scenario:line if paths come from config object HOT 4
- Skip step based on a tag HOT 1
- FEATURE: Support to specify test-run parameters/properties for test reports
- behave erroring in pretty format in pyproject.toml HOT 4
- Feature Request: Configuration of Feature, Environment & Steps paths HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from behave.