aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/behaveframework.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-11-09 12:28:24 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2019-11-09 13:02:54 +0100
commit728f5c95df4d3edbe6b3f814a270cdf3b532aef9 (patch)
treeb07289945c7bdc6c938ab9dc3b93538a2e6d1feb /xtesting/core/behaveframework.py
parent7ddcfae7ff8a20fac21f5ba2b923e8e5cbce19e5 (diff)
Generate Html and Xunit Behave reports
Change-Id: I7d5f31502ba61b61a0b1c885fe8828211bc0bc0a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/core/behaveframework.py')
-rw-r--r--xtesting/core/behaveframework.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/xtesting/core/behaveframework.py b/xtesting/core/behaveframework.py
index 25986f48..ede3883f 100644
--- a/xtesting/core/behaveframework.py
+++ b/xtesting/core/behaveframework.py
@@ -14,7 +14,9 @@ from __future__ import division
import logging
import os
import time
+
import json
+import six
from behave.__main__ import main as behave_main
@@ -102,8 +104,12 @@ class BehaveFramework(testcase.TestCase):
self.__logger.exception("Cannot create %s", self.res_dir)
return self.EX_RUN_ERROR
config = ['--tags='+','.join(tags),
- '--format=json',
- '--outfile='+self.json_file]
+ '--junit', '--junit-directory={}'.format(self.res_dir),
+ '--format=json', '--outfile={}'.format(self.json_file)]
+ if six.PY3:
+ html_file = os.path.join(self.res_dir, 'output.html')
+ config += ['--format=behave_html_formatter:HTMLFormatter',
+ '--outfile={}'.format(html_file)]
for feature in suites:
config.append(feature)
self.start_time = time.time()