Web UI自动化测试框架(4)
StartPage.py使用了一个笨方法把所有的类集合到这里
import os
from Runner.TestRunner import *
from time import sleep
from Jiexxxx import *
from AutoScripts.Jiexxxx import *
#from DBManage.Userinfo import *
if __name__ == "__main__":
test = unittest.TestSuite()
conf = cp
sections = cp.sections()
for j in sections:
if j == u"Jiexxxxx1":
items = conf.items('Jiexxxxx')
for i in items:
test.addTest(Jiexxxxx1(i[1]))
runner = TestRunner('./',conf.get('title','content'),conf.get('description','content'))
runner.run(test)
config 文件描述如下:
[Jiexxxx1] //对应了要运行的类方法
test2 = login1 //要运行的测试脚本
[title]
content = 妙笔生花自动化测试 //测试报告title
[description]
content = 妙笔生花自动化验证 //测试描述
测试报告如下