How to get summary into an output in Python-Behave

2.2k views Asked by At

This is a summary of the tests after it runs:

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined

I want to be able to print it into a file or have access to it from the modules. The behave documentations doesn't have an argument that makes the summary print into a a different output.

2

There are 2 answers

1
Chong On

In the script or somewhere you trigger you test, why not simply do a

behave -o out_file > file_to_save_summary

0
Uncle John On

Create an empty "output" folder in your behave folder. Also create a file "behave.ini" and put it in your behave folder:

Here is the content of your "behave.ini" file:

    [behave]
    junit: true
    junit_directory: <route_to_behave_folder>/output/
    stderr_capture=False
    stdout_capture=True