sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #46015
[Question #664776]: I need to generate HTML report using screenshot
New question #664776 on Sikuli:
https://answers.launchpad.net/sikuli/+question/664776
@ Raiman
Hi,
i need to generate html reports with screenshots
I looked into the question 250286 and i understood what i need to add to the code to take the screen shot
**i cant access this modified version link --
https://dl.dropboxusercontent.com/u/42895525/HTMLTestRunner.zip
i did this changes in my current HTMLTestRunner
def addSuccess(self, test):
self.success_count += 1
TestResult.addSuccess(self, test)
output = self.complete_output()
self.result.append((0, test, output, ''))
if self.verbosity > 1:
sys.stderr.write('ok ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('.')
def addError(self, test, err):
self.error_count += 1
TestResult.addError(self, test, err)
_, _exc_str = self.errors[-1]
output = self.complete_output()
self.result.append((2, test, output, _exc_str, self.generateTestScreenshot(test)))
if self.verbosity > 1:
sys.stderr.write('E ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('E')
def addFailure(self, test, err):
self.failure_count += 1
TestResult.addFailure(self, test, err)
_, _exc_str = self.failures[-1]
output = self.complete_output()
self.result.append((1, test, output, _exc_str, self.generateTestScreenshot(test)))
if self.verbosity > 1:
sys.stderr.write('F ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('F')
please tell me what to change in here:
class ImportProject(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test1():
pass
def test2():
pass
suite = unittest.TestLoader().loadTestsFromTestCase(importProject)
outFile = open("report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outFile, title='test report', description='test case description' )
runner.run(suite)
please tell me if i am doing something wrong
Thanks in advance
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.