简体   繁体   中英

How to get summary into an output in Python-Behave

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 aa different output.

在脚本或触发测试的地方,为什么不简单地做一个

behave -o out_file > file_to_save_summary

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM