问题
I automated an application using sikuli. Now the program is full of image (usual sikuli program), I want to generate the final report for the test cases. I can only see the option for robot framework to generate the report. I don't know python. How can I do that without robot framework? Can you jus guide me with the steps to do that? if there is no option guide with the normal way. Thanks
回答1:
You can try one of those two:
- HTMLTestRunner can be used by adding this script (and the .py file) to your currrent solution:
--script--
from sikuli import *
import unittest
import HTMLTestRunner
Class ClassName(unittest.TestCase):
#paste your script
suite = unittest.TestLoader().loadTestsFromTestCase(ClassName)
outfile = open("C:\\Sikuli\\Reports\\report.html", "w") # path to report folder
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' )
runner.run(suite)
- XMLTestRunner almost the same as above:
--script--
import xmlrunner
import unittest
class MyTest(unittest.TestCase):
def setUp(self):
// setUp
def testMyTest(self):
// test
def tearDown(self):
// tearDown
suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
result = XMLTestRunner(file("unittest.xml", "w")).run(suite)
来源:https://stackoverflow.com/questions/27418416/how-to-generate-report-using-sikuli-for-desktop-application