作者在 2016-04-22 17:28:11 发布以下内容
#-*- coding:UTF-8 -*-
'''
Created on 2016-4-12
@author: poptest
'''
from xml.dom import minidom
class ReadXMLDriver():
def readXmlData(self,filename,elementfirstnode,num,elementsecondnode):
#找xml的路径
dom = minidom.parse('../ShopDateModel/'+filename)
#最大的父类
root = dom.documentElement
#一级节点
parnote = root.getElementsByTagName(elementfirstnode)[num]
#二级节点
secondnote = parnote.getElementsByTagName(elementsecondnode)[0].childNodes[0].nodeValue
return secondnote
''
Created on 2016-4-12
@author: poptest
'''
import unittest
from ShareLibModel import TestReporter
M = TestReporter.htmlreporter()
#from
#Q = SendEmail.SendEmailReporter()
class TestSuite(unittest.TestCase):
def testbao(self):
suite = unittest.TestSuite()
from TestZCCaseModel import V3case33
from TestZCCaseModel import V1login
suite.addTest(unittest.makeSuite(V3case33.Test))
suite.addTest(unittest.makeSuite(V1login.login()))
M.TestReport("aa.html",suite)
#Q.SendMail("aw.html")
if __name__ == "__main__":
unittest.main()
'''
Created on 2016-4-12
@author: poptest
'''
import HTMLTestRunner
class htmlreporter():
def TestReport(self,filename,rve_parameter):
filename = "../Reporter/"+filename
with open(filename, "wb") as fhtml:
HTMLTestRunner.HTMLTestRunner(
stream = fhtml,
title = "aa",
verbosity = 2,
description = "aa"
).run(rve_parameter)
AddressXML
<?xml version="1.0" encoding="utf-8"?>
<AddressData>
<test001>
<id1>com.subject.zhongchou:id/back</id1>
<id2>//android.widget.TextView[@text='众筹网登录']</id2>
<text2>众筹网登录</text2>
<id3>com.subject.zhongchou:id/func_text</id3>
<text3>注册</text3>
<id4>com.subject.zhongchou:id/go_fastlogin</id4>
<text4>手机快速登录</text4>
<id5>com.subject.zhongchou:id/go_defaultlogin</id5>
<text5>普通账号登录</text5>
<id6>com.subject.zhongchou:id/loginnumber_phones</id6>
<text6>请输入您的手机号/邮箱/用户名</text6>
<id7>com.subject.zhongchou:id/loginnumber_password</id7>
<text7>请输入密码</text7>
<id8>com.subject.zhongchou:id/go_numberlogin</id8>
<text8>登录</text8>
<id9>com.subject.zhongchou:id/goto_lostpsw_page</id9>
<text9>忘记密码</text9>
<id10>com.subject.zhongchou:id/third_part_login</id10>
<text10>第三方账号登录</text10>
<id11>//android.widget.TextView[@text='微信']</id11>
<text11>微信</text11>
<id12>//android.widget.TextView[@text='QQ']</id12>
<text12>QQ</text12>
<id13>//android.widget.TextView[@text='微博']</id13>
<text13>微博</text13>
<id14>com.subject.zhongchou:id/goto_wxlogin</id14>
<id15>com.subject.zhongchou:id/goto_qqlogin</id15>
<id16>com.subject.zhongchou:id/goto_sinalogin</id16>
</test001>
</AddressData>