I'm using Behave on Python to test a web application. My test suite run properly, but I'm not able to generate junit report.
Here is my behave.ini file :
[behave]
junit=true
format=pretty
I only run behave using this command :behave
After run, the test result is print in the console, but no report is generated.
1 feature passed, 3 failed, 0 skipped
60 scenarios passed, 5 failed, 0 skipped
395 steps passed, 5 failed, 5 skipped, 0 undefined
Took 10m17.149s
What can I do ?
The Python unit testing framework, dubbed 'PyUnit' by convention, is a Python language version of JUnit, by smart cookies Kent Beck and Erich Gamma. JUnit is, in turn, a Java version of Kent's Smalltalk testing framework. Each is the de facto standard unit testing framework for its respective language.
For Behave installation, we should have pip – the package installer for the Python language installed in our system. The pip is installed by default, if the Python version is greater than 2(upto 2.7. 9). We can also use the easy_install for the Behave installation.
Make sure you don't change the working directory in your steps
definition (or, at the end of the test change it back to what it was before).
I was observing the same problem, and it turned out that the reports
directory was created in the directory I changed into while executing one of the steps.
What may help, if you don't want to care about the working directory, is setting the --junit-directory
option. This should help behave to figure out where to store the report, regardless of the working directory at the end of the test (I have not tested that though)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With