svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 325 forks source link

Can we get the output in the CSV/HTML format for the respective RESTful API test case #240

Open mravitej opened 7 years ago

mravitej commented 7 years ago

Currently, I can see the output in the command prompt as below.

Output: Test Group login-func SUCCESS:: 1/1 Tests Passed!

Expectation: Can we get this output in auto generated CSV/HTML file?

mravitej commented 6 years ago

There doesn't appear to be a flag for Pyresttest to produce CSV, HTML, or a similar kind of output like JSON. The only other thing we can call the relevant logic from a Python program.

util/pyresttest within the source code, we can see it delegates to pyresttest/resttest.py. That file contains the logic for running the tests and printing the responses. so i customized the resttest.py to print

PASS/FAIL for individual test cases Number of test cases Passed or Failed in a group The whole result will parse to test_name_file.html

Just download zip file and extract it, the resttest.py will be present . Place it in pyresttest/pyresttest directory and run following command from pyresttest directory

$ sudo python setup.py install resttest.zip