|
|
@@ -1,6 +1,6 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
import HTMLTestRunner
|
|
|
-import os,unittest,copy,time
|
|
|
+import os,unittest,copy
|
|
|
from appium import webdriver
|
|
|
from time import sleep
|
|
|
from common.utility import *
|
|
|
@@ -88,19 +88,16 @@ class PYtest(unittest.TestCase):
|
|
|
self.driver.swipe(720,700,0,700)
|
|
|
print ('Swip Passed')
|
|
|
|
|
|
+ #测试查询账号及 单聊除相册外的所有功能
|
|
|
def py_findByName(self):
|
|
|
- findByName(self,'ceshilqq','贺贵良')
|
|
|
- self.driver.find_element_by_xpath('//android.widget.ImageButton[@resource-id=\"cn.wswin.moa:id/fab_profile\"]').click()
|
|
|
- self.driver.find_element_by_id('cn.wswin.moa:id/rv_chat_list').send_keys('oh my God!')
|
|
|
- self.driver.find_element_by_id('cn.wswin.moa:id/iv_chat_send_msg').click()
|
|
|
- # self.driver.find_element_by_xpath('//android.widget.EditText[@resource-id=\"cn.wswin.moa:id/et_chat\"]').send_keys('oh my god!')
|
|
|
+ findByName(self,'ceshilqq','贺贵良')#测试查找功能
|
|
|
+ regularOperation(self,'')
|
|
|
+ restApp(self)
|
|
|
|
|
|
|
|
|
- def py_newActivity(self):
|
|
|
- current_Act = self.driver.current_activity
|
|
|
- self.driver.wait_activity('.ui.activity.MainActivity',5)
|
|
|
+ def tearDown(self):
|
|
|
+ print ''
|
|
|
|
|
|
- sleep(100)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
suite = unittest.TestSuite()
|
|
|
@@ -108,13 +105,12 @@ if __name__ == '__main__':
|
|
|
# suite.addTest(PYtest('py_Swiap'))
|
|
|
suite.addTest(PYtest('py_login'))#APP登录
|
|
|
suite.addTest(PYtest('py_findByName'))
|
|
|
- # suite.addTest(PYtest('py_newActivity'))#打开新页面
|
|
|
suite.addTest(PYtest('py_quitApp'))#APP登出
|
|
|
suite.addTest(PYtest('finishDriver'))#结束测试
|
|
|
- # unittest.TextTestRunner(verbosity=1).run(suite)#执行测试用例
|
|
|
- timestr = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
|
|
|
- filename = "D:\\AutoTest\\report\\report_" + timestr + ".html"
|
|
|
- fp = file(filename, "wb")
|
|
|
- runner =HTMLTestRunner.HTMLTestRunner(stream=fp, title=u'测试报告', description=u'测试用例详情')
|
|
|
- runner.run(suite)
|
|
|
- fp.close()
|
|
|
+ unittest.TextTestRunner(verbosity=1).run(suite)#执行测试用例
|
|
|
+ # timestr = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
|
|
|
+ # filename = "D:\\AutoTest\\report\\report_" + timestr + ".html"
|
|
|
+ # fp = file(filename, "wb")
|
|
|
+ # runner =HTMLTestRunner.HTMLTestRunner(stream=fp, title=u'测试报告', description=u'测试用例详情')
|
|
|
+ # runner.run(suite)
|
|
|
+ # fp.close()
|