← Back to team overview

sikuli-driver team mailing list archive

[Question #268110]: To create a Test List that could have multiple Test suite and generate a report throuhg the HTMLTestRunner usage

 

New question #268110 on Sikuli:
https://answers.launchpad.net/sikuli/+question/268110

Hello,

I am trying to create a Test list to which I need to add test suites and then  generate reports through HTMLTestRunner in Sikuli.We excute this through Command Prompt .

My Test Suite are in the folder :- "c://SikuliX"

C:/Sikulix/AddCredit.Sikuli
C:/Sikulix/XYZ.Sikuli
C:/Sikulix/DEF.Sikuli

I now need to create a Test List with these 3 test suite added to it and generate a report through HTMLTestRunner. For the moment I am only trying to add one Test suite "AddCredit" to the Test List and generate the Report.

Please find the code/script below that should both generate the Test list by adding the "AddCredit" suite to it and generate the Report.

sikuliPath = "C:\\SikuliX"
if not sikuliPath in sys.path: sys.path.append(sikuliPath)
import sys

import HTMLTestRunner
reload(HTMLTestRunner)
import unittest



def RunSuite(testCase):
    outfile = open("C:\\Results\\Results.html", "w")
    runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Tests Executed', description='Suite with all tests')  
    runner.run(suite) 

import AddCredit
testCaseForUITests=AddCredit
suite=unittest.TestSuite()  
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(testCaseForUITests))  
RunSuite()

Exit

Issues:

1) We are getting the following error
[error] TypeError ( issubclass() arg 1 must be a class ) at the line where the code "testCaseForUITests=AddCredit " is written.

I have read in some forums that we need to call the method within the test suite (in my case method with AddCredit) to run them. My Sikuli file AddCredit doesn't have any methods as script written in them directly perform the operation.

2)
When I excute the AddCredit it excutes correctly but if need to add it to TestList and generate the HTML report We are facing issue reported ablve.

Please advise.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.