← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #707102]: How to append saved screenshot to htmltestrunner report

 

Question #707102 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/707102

JP gave more information on the question:
I have amended my code like this but still doesn't seem to append any
screenshot on failed test case with the HTMLTestRunner:

#from sikuli import *
import sys
import HTMLTestRunner
import unittest


class ReturnToHome(unittest.TestCase): 

    def setUp(self):
        click(Images.chrome)
        wait(5)
    
    def test_aReturnToHome(self):
        click(Location(300, 247))
        wait(3)   
        if exists(Images.xl): #it will fail becuase is not present
            assert True, "Image found"
        else:
            assert False, "Image not found"

    def tearDown(self):
        print 'Test Failed'

        
suite = unittest.TestLoader().loadTestsFromTestCase(ReturnToHome)
outfile = open('C:\jenkins\workspace\ReturnToHome\TestReport.html', 'w')
myrunner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Return to Home', description ='' )
myrunner.run(suite)                       

I'm using the HTMLTesteRunner located in the AppData folder and it is
the version modified by Raiman.

Does anyone have any idea why is not appending the screenshot?

Thank you

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.