Browse Source

update moaTest

hegl 8 years ago
parent
commit
8c94253110
2 changed files with 24 additions and 21 deletions
  1. 10 3
      .idea/workspace.xml
  2. 14 18
      MyTest/moaTest.py

+ 10 - 3
.idea/workspace.xml

@@ -4,7 +4,6 @@
     <list default="true" id="82c8521e-4e92-439a-a797-bd5cecfdccd4" name="Default" comment="">
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MyTest/moaTest.py" afterPath="$PROJECT_DIR$/MyTest/moaTest.py" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/common/utility.py" afterPath="$PROJECT_DIR$/common/utility.py" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="TRACKING_ENABLED" value="true" />
@@ -756,7 +755,14 @@
       <option name="project" value="LOCAL" />
       <updated>1495095859869</updated>
     </task>
-    <option name="localTasksCounter" value="18" />
+    <task id="LOCAL-00018" summary="update untility add regularOperation、restApp">
+      <created>1495869639207</created>
+      <option name="number" value="00018" />
+      <option name="presentableId" value="LOCAL-00018" />
+      <option name="project" value="LOCAL" />
+      <updated>1495869639207</updated>
+    </task>
+    <option name="localTasksCounter" value="19" />
     <servers />
   </component>
   <component name="TestHistory">
@@ -843,7 +849,8 @@
     <MESSAGE value="update moaTest.py add py_findByName" />
     <MESSAGE value="modify utility" />
     <MESSAGE value="modify utility、moaTest" />
-    <option name="LAST_COMMIT_MESSAGE" value="modify utility、moaTest" />
+    <MESSAGE value="update untility add regularOperation、restApp" />
+    <option name="LAST_COMMIT_MESSAGE" value="update untility add regularOperation、restApp" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 14 - 18
MyTest/moaTest.py

@@ -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()