AppUi自动化框架main.py代码
Posted laosun0204
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AppUi自动化框架main.py代码相关的知识,希望对你有一定的参考价值。
from lib.path import APPCASE, LOGPATH,APPREPORT
# from lib.HTMLTestAppRunner import HTMLTestRunner
import unittest
from lib.appController import Controller
from BeautifulReport import BeautifulReport
class Main(object):
def __init__(self):
self.controller = Controller()
self.deviceName = self.controller.deviceName
def run(self):
self.controller.start_server()
if self.controller.test_server():
self.controller.start_driver()
suite = unittest.TestSuite()
cases = unittest.defaultTestLoader.discover(APPCASE)
for case in cases:
suite.addTest(case)
run = BeautifulReport(suite)
run.report(filename = ‘{}.html‘.format(self.deviceName),description = ‘用例执行情况‘,
log_path = APPREPORT)
# f = open(APPREPORT.format(‘{}.html‘.format(self.deviceName)), ‘wb‘)
# runner = HTMLTestRunner(f, verbosity=1, title=u‘测试报告‘, description=u‘用例执行情况:‘)
# runner.run(suite)
# f.flush()
# f.close()
if __name__ == ‘__main__‘:
m = Main()
m.run()
以上是关于AppUi自动化框架main.py代码的主要内容,如果未能解决你的问题,请参考以下文章