-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestManager.py
25 lines (23 loc) · 1.02 KB
/
TestManager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#-- import Section
#-- import all your testsuites(class level testcases here)
from TestSuites import apiTest
from TestSuites import uiTest
import unittest
#-- Add All your Testsuites Here
Suites = []
Suites.append(apiTest.functionality1)
Suites.append(uiTest.googleTest)
#-- It will return the testSuites in HTML format
def testSuitesInHtmlFormat():
testcases = ""
for testSuite in Suites:
loadSuite = unittest.TestLoader().loadTestsFromTestCase(testSuite)
totalTestCases = loadSuite.countTestCases()
for test in range(totalTestCases):
strTest = str(loadSuite._tests[test])
_suiteName = strTest.split('.')[-1][0:-1]
_testName = strTest.split(' ')[0]
chkboxValue = {"module":strTest.split(' ')[1][1:-1],"method":_testName}
testCaseRow = '<tr><td><input type="checkbox" class="chkTest" name="chkTest" value="'+str(chkboxValue)+'"></th><th>'+_suiteName+'</th><th>'+_testName+'</th></tr>'
testcases = testcases + testCaseRow
return testcases