7

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 ?

1
  • I observe something similar with behave 1.2.5. I get the report when all scenarios pass, but no report as soon as there's a failure. Commented Jun 3, 2016 at 12:50

3 Answers 3

2

Try using

behave --junit

on the command line instead of just behave.

Also, you can show the options available by using:

behave --help
Sign up to request clarification or add additional context in comments.

Comments

2

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)

1 Comment

Your answer makes sense but here the Question is about the behave.ini file entry and whether its correct?
-2

I have done a bit of searching and it appears that the easiest way to do this is via the Jenkins junit plugin.

It seems to me like there ought to be a simple way to convert junit xml reports to a human readable html format, but I have not found it in any of my searches. The best I can come up with are a few junit bash scripts, but they don't appear to have any publishing capability. They only generate the xml reports.

1 Comment

Jenkins needs junit XML to generate behave report. This question was about behave not generating the report even though --junit option was set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.