Code Monkey home page Code Monkey logo

Comments (38)

inrix-yi-gu avatar inrix-yi-gu commented on May 24, 2024 4

+1

from behave.

sseliverstov avatar sseliverstov commented on May 24, 2024 3

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.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024 2

@bittner : can we add logs and steps in this report as well ?

from behave.

bittner avatar bittner commented on May 24, 2024 2

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.

s1ider avatar s1ider commented on May 24, 2024 1

Hey, what about that pull request? People want HTML!
Please let me know if I can help to make this quicker.

from behave.

Lucas-C avatar Lucas-C commented on May 24, 2024 1

Interesting ! I wrote something similar: https://gist.github.com/Lucas-C/2ba14f253186e8df079219a3038e7d94
But ideally it should be included in behave

from behave.

andreybehalf avatar andreybehalf commented on May 24, 2024 1

@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.

quantoid avatar quantoid commented on May 24, 2024

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.

vrutkovs avatar vrutkovs commented on May 24, 2024

@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.

spinus avatar spinus commented on May 24, 2024

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.

tomatobrown avatar tomatobrown commented on May 24, 2024

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.

vrutkovs avatar vrutkovs commented on May 24, 2024

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.

jenisys avatar jenisys commented on May 24, 2024

@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.

ShantanuMujumdar avatar ShantanuMujumdar commented on May 24, 2024

Thanks all for your efforts! By chance is the html report generation for behave working? I really need it.

from behave.

gerosalesc avatar gerosalesc commented on May 24, 2024

+1

from behave.

Lucas-C avatar Lucas-C commented on May 24, 2024

Great idea, and awesome work so far !
Please go on :)

from behave.

andreybehalf avatar andreybehalf commented on May 24, 2024

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.

andreybehalf avatar andreybehalf commented on May 24, 2024

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.

kaskelotti avatar kaskelotti commented on May 24, 2024

Hmmm... We have a JSON formatted output already, couldn't that be used to geneate HTML report by some templating?

from behave.

andreybehalf avatar andreybehalf commented on May 24, 2024

@kaskelotti Check this mate: https://www.npmjs.com/package/cucumber-html-report

from behave.

kaskelotti avatar kaskelotti commented on May 24, 2024

@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.

andreybehalf avatar andreybehalf commented on May 24, 2024

@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.

sseliverstov avatar sseliverstov commented on May 24, 2024

Now it is possible, just make attachment in hook. Also you can attach your data form any step. Enjoy;)

from behave.

stale avatar stale commented on May 24, 2024

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.

eliezercazares avatar eliezercazares commented on May 24, 2024

Wow, this has been hanging around for years.

from behave.

ScarletMcLearn avatar ScarletMcLearn commented on May 24, 2024

Still no update

from behave.

vishwas-tomar-telus avatar vishwas-tomar-telus commented on May 24, 2024

Any update on this please..

from behave.

bittner avatar bittner commented on May 24, 2024

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.
    [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

from behave.

bittner avatar bittner commented on May 24, 2024

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.

swatantrasrivastava avatar swatantrasrivastava commented on May 24, 2024

I want to add logs and steps which is showing in CLI in the report, as these displays in Extent report.

from behave.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024

Hi @bittner
Can we attach screenshots of failure cases in behave-html-formatter report ?

from behave.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024

@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.

bittner avatar bittner commented on May 24, 2024

@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.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024

@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.

bittner avatar bittner commented on May 24, 2024

how can I go to there issue tracker ?

https://github.com/allure-framework/allure-python/issues

from behave.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024

from behave.

bittner avatar bittner commented on May 24, 2024

@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:

  1. Search the documentation for the topics you need help with. (We have extensive documentation; the table of contents covers a lot of popular topics.)
  2. Search the issue tracker, make sure this question hasn't been asked and answered before.
  3. 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.

swatantra15081986 avatar swatantra15081986 commented on May 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.