首页 > 移动平台 > 详细

AppUi自动化框架main.py代码

时间:2018-10-06 21:56:19      阅读:214      评论:0      收藏:0      [点我收藏+]
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代码

原文:https://www.cnblogs.com/laosun0204/p/9748672.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!