Best Python code snippet using playwright-python
stg_tc_iPhone7_ios11.py
Source: stg_tc_iPhone7_ios11.py
1#coding=utf-82#test purpose : verify the main features on iPhone3#os: iOS4#device: iPhone75#version:iOS11.3.16#author: Sam Wang7#update date: created by Sam [2018-11-22]8import unittest9import time10import os11import random12from time import sleep13from appium import webdriver14from selenium.webdriver.common.desired_capabilities import DesiredCapabilities15from appium.webdriver.common.touch_action import TouchAction16from HTMLTestReportEN import HTMLTestRunner17from common_iPhone7_ios11_stg import fun_myfansui_check18from common_iPhone7_ios11_stg import fun_mywatchui_check19from common_iPhone7_ios11_stg import fun_mypublishui_check20from common_iPhone7_ios11_stg import bp_is_loggedin21from common_iPhone7_ios11_stg import fun_getinfo22from common_iPhone7_ios11_stg import bp_normalloginmp23from common_iPhone7_ios11_stg import bp_is_loginshow24from common_iPhone7_ios11_stg import fun_getloginmenu25from common_iPhone7_ios11_stg import bp_is_plusexist26from common_iPhone7_ios11_stg import bp_is_publishnowexist27from common_iPhone7_ios11_stg import bp_is_openmultichatexist28from common_iPhone7_ios11_stg import fun_findui_check29from common_iPhone7_ios11_stg import fun_personalinfoui_check30from common_iPhone7_ios11_stg import fun_scoredetailui_check31from common_iPhone7_ios11_stg import fun_giftui_check32from common_iPhone7_ios11_stg import fun_articleui_check33from common_iPhone7_ios11_stg import fun_cartui_check34from common_iPhone7_ios11_stg import fun_pgcui_check35#from common_iPhone7_ios11_stg import fun_articledetailui_check36#from common_iPhone7_ios11_stg import fun_giftorderui_check37#from common_iPhone7_ios11_stg import fun_giftorderdetailui_check38from common_iPhone7_ios11_stg import fun_getjingxiloginmenu39# Returns abs path relative to this file and not cwd40PATH = lambda p: os.path.abspath(41 os.path.join(os.path.dirname(__file__), p)42)43class Weilai_test(unittest.TestCase):44 def setUp(self):45 desired_caps = {}46 desired_caps['platformName'] = 'iOS'47 desired_caps['browserName']=''48 desired_caps['automationName'] = 'XCUITest'49 desired_caps['platformVersion'] = '11.3'50 desired_caps['deviceName'] = 'iPhone7B'51 desired_caps['app'] = os.path.abspath('../../test_data/app/ios_package/NextevCarInhouseQA.ipa')52 desired_caps['udid'] = '538a602ef0730186afc7c89cd6b38120409114f2'53 desired_caps['noReset'] = True54 #desired_caps['clearSystemFiles'] = True55 desired_caps['xcodeOrgId'] = 'L8MRL9B64V'56 #desired_caps['xcodeSigning'] = 'iPhone Developer'57 self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)58 self.driver.implicitly_wait(15)59 sleep(2)60 def tearDown(self):61 # end the session62 self.driver.quit()63#*******************************************************64#TC Name:test_wode_fans_tc00165#Purpose:æ£æ¥æç页é¢ç¹å»ç²ä¸åå¼¹åºé¡µé¢çå项åè½66#OS:iOS67#Device:iPhone768#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app69#Post-conditions:N/A70#Modify History:created by Sam [2018/08/13]71#*******************************************************72 def test_wode_fans_tc001(self):73 driver=self.driver74 print('TC_æ£æ¥ç¨æ·æ¨¡å¼æå¼APPï¼æ£æ¥ç¹:æç_ç²ä¸åè½----step1æ£æ¥æç页é¢ç¹å»ç²ä¸å页é¢å个å
ç´ æ¯å¦åå¨')75 print('step2åæ¶äºç¸å
³æ³¨/å
³æ³¨ï¼step3æ£æ¥è¢«åæ¶äºç¸å
³æ³¨/å
³æ³¨çç²ä¸å
³ç³»æ¯å¦åæ+å
³æ³¨/äºç¸å
³æ³¨')76 now=time.strftime('%Y-%m-%d %H_%M_%S')77 print('TC_æç_ç²ä¸é¡µé¢å
ç´ æ£æ¥ååæ¶äºç¸å
³æ³¨/+å
³æ³¨åè½æ£æ¥----å¼å§:'+now)78 sleep(2)79 driver.find_element_by_accessibility_id('è¿å').click()80 sleep(2)81 #æç82 driver.find_element_by_accessibility_id('æç').click()83 sleep(3)84 #ç²ä¸85 #driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[5]').click()86 driver.find_element_by_accessibility_id('ç²ä¸').click()87 sleep(3)88 #æ£æ¥ç²ä¸é¢çå个å
ç´ æ¯å¦åå¨89 c1=fun_myfansui_check(self)90 sleep(2)91 if c1 == True:92 print('ç²ä¸é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£æ¥å®æ¯')93 sleep(1)94 #åæ¶äºç¸å
³æ³¨95 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()96 sleep(3)97 #...98 driver.find_element_by_accessibility_id('icon more white').click()99 sleep(1)100 driver.find_element_by_accessibility_id('åæ¶å
³æ³¨').click()101 sleep(1)102 #check the message of toast103 n1=driver.find_elements_by_accessibility_id('åæ¶æå')104 if len(n1) != 0:105 print('åæ¶å
³æ³¨çåè½æ£æ¥éè¿--è天-->å
³æ³¨')106 sleep(1)107 else:108 print('åæ¶å
³æ³¨çåè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')109 sleep(1)110 now=time.strftime('%Y-%m-%d %H_%M_%S')111 sf2='../../test_report/ios/'+now+'_errorCancelWatch_R_stg_tc001.png'112 driver.get_screenshot_as_file(sf2)113 sleep(2)114 driver.find_element_by_accessibility_id('full screen back icon').click()115 sleep(2)116 #+å
³æ³¨117 driver.find_element_by_accessibility_id('å
³æ³¨').click()118 sleep(1)119 #check the message of toast120 n2=driver.find_elements_by_accessibility_id('å
³æ³¨æå')121 if len(n2) != 0:122 print('+å
³æ³¨çåè½æ£æ¥éè¿--å
³æ³¨-->è天')123 sleep(1)124 else:125 print('+å
³æ³¨çåè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')126 sleep(1)127 now=time.strftime('%Y-%m-%d %H_%M_%S')128 sf2='../../test_report/ios/'+now+'_errorPlusWatch_R_stg_tc001.png'129 driver.get_screenshot_as_file(sf2)130 sleep(1)131 driver.find_element_by_accessibility_id('all page back black icon').click()132 sleep(1)133 now=time.strftime('%Y-%m-%d %H_%M_%S')134 print('TC_æç_ç²ä¸é¡µé¢å
ç´ æ£æ¥ååæ¶äºç¸å
³æ³¨/+å
³æ³¨åè½æ£æ¥----ç»æ:'+now)135#*******************************************************136#TC Name:test_wode_watch_tc002137#Purpose:æ£æ¥æç页é¢ç¹å»å
³æ³¨åå¼¹åºé¡µé¢çå项åè½138#OS:iOS139#Device:iPhone7140#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app141#Post-conditions:N/A142#Modify History:created by Sam [2018/08/10]143#*******************************************************144 def test_wode_watch_tc002(self):145 driver=self.driver146 print('TC_æ£æ¥ç¨æ·æ¨¡å¼æå¼APPï¼æ£æ¥ç¹:æç_å
³æ³¨åè½----step1æ£æ¥æç页é¢ç¹å»åå¸å页é¢å个å
ç´ æ¯å¦åå¨')147 print('step2æ£æ¥åæ¶å
³æ³¨æ¯å¦æåï¼step3æ£æ¥å å
³æ³¨æ¯å¦æå')148 now=time.strftime('%Y-%m-%d %H_%M_%S')149 print('TC_æç_å
³æ³¨é¡µé¢å
ç´ æ£æ¥ååæ¶å
³æ³¨åå å
³æ³¨çåè½----å¼å§:'+now)150 sleep(2)151 driver.find_element_by_accessibility_id('è¿å').click()152 sleep(2)153 #æç154 driver.find_element_by_accessibility_id('æç').click()155 sleep(3)156 #å
³æ³¨157 driver.find_element_by_accessibility_id('å
³æ³¨').click()158 #driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[4]').click()159 sleep(3)160 #æ£æ¥åå¸å
³æ³¨é¢çå个å
ç´ æ¯å¦åå¨161 c1=fun_mywatchui_check(self)162 sleep(2)163 if c1==True:164 print('å
³æ³¨é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£å¸¸æ¾ç¤º.')165 sleep(2)166 #åæ¶å
³æ³¨167 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()168 sleep(3)169 #...170 driver.find_element_by_accessibility_id('icon more white').click()171 sleep(1)172 driver.find_element_by_accessibility_id('åæ¶å
³æ³¨').click()173 sleep(1)174 #check the toast175 n=driver.find_elements_by_accessibility_id('åæ¶æå')176 if len(n) != 0:177 print('åæ¶äºç¸å
³æ³¨çåè½æ£æ¥éè¿--è天-->å
³æ³¨')178 sleep(1)179 else:180 print('åæ¶äºç¸å
³æ³¨çåè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')181 sleep(1)182 now=time.strftime('%Y-%m-%d %H_%M_%S')183 sf1='../../test_report/ios/'+now+'_errorCancelMuCare_R_tc002.png'184 driver.get_screenshot_as_file(sf1)185 sleep(2)186 driver.find_element_by_accessibility_id('full screen back icon').click()187 sleep(2)188 #+å
³æ³¨189 driver.find_element_by_accessibility_id('å
³æ³¨').click()190 sleep(1)191 m=driver.find_elements_by_accessibility_id('å
³æ³¨æå')192 if len(m) != 0:193 print('+å
³æ³¨çåè½æ£æ¥éè¿--å
³æ³¨-->è天')194 sleep(1)195 else:196 print('+å
³æ³¨çåè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')197 sleep(1)198 now=time.strftime('%Y-%m-%d %H_%M_%S')199 sf1='../../test_report/ios/'+now+'_errorAddCare_R_tc002.png'200 driver.get_screenshot_as_file(sf1)201 sleep(2)202 """203 #-å
³æ³¨204 driver.find_element_by_accessibility_id('å·²å
³æ³¨').click()205 sleep(1)206 m2=driver.find_elements_by_accessibility_id('åæ¶æå')207 if len(m2) != 0:208 print('åæ¶å
³æ³¨çåè½æ£æ¥éè¿--å·²å
³æ³¨-->å
³æ³¨')209 sleep(1)210 else:211 print('åæ¶å
³æ³¨çåè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')212 sleep(1)213 now=time.strftime('%Y-%m-%d %H_%M_%S')214 sf1='../../test_report/ios/'+now+'_errorCancelCare_R_tc002.png'215 driver.get_screenshot_as_file(sf1)216 sleep(1)217 """218 driver.find_element_by_accessibility_id('all page back black icon').click()219 sleep(1)220 now=time.strftime('%Y-%m-%d %H_%M_%S')221 print('TC_æç_å
³æ³¨é¡µé¢å
ç´ æ£æ¥ååæ¶å
³æ³¨åå å
³æ³¨çåè½----ç»æ:'+now)222#*******************************************************223#TC Name:test_wode_publish_tc003224#Purpose:æ£æ¥æç页é¢ç¹å»åå¸åå¼¹åºé¡µé¢çå项åè½225#OS:iOS226#Device:iPhone7227#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app228#Post-conditions:N/A229#Modify History:created by Sam [2018/08/10]230#*******************************************************231 def test_wode_publish_tc003(self):232 driver=self.driver233 print('TC_æ£æ¥ç¨æ·æ¨¡å¼æå¼APPï¼æ£æ¥ç¹:æç_åå¸åè½----step1æ£æ¥æç页é¢ç¹å»åå¸å页é¢å个å
ç´ æ¯å¦åå¨')234 print('step2åå¸åè½æ¯å¦æ£å¸¸ï¼step3æ£æ¥åå¸å
容éæ¯å¦å¯ä»¥ä¸æ¬¡æ大ä¸ä¼ 9å¼ å¾çï¼step4æ£æ¥åå¸æåæ¯å¦æ£ç¡®')235 now=time.strftime('%Y-%m-%d %H_%M_%S')236 print('TC_æç_åå¸é¡µé¢å
ç´ æ£æ¥ååå¸åè½----å¼å§:'+now)237 sleep(2)238 driver.find_element_by_accessibility_id('è¿å').click()239 sleep(2)240 #æç241 driver.find_element_by_accessibility_id('æç').click()242 sleep(2)243 #åå¸244 driver.find_element_by_accessibility_id('åå¸').click()245 #driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[3]').click()246 sleep(2)247 #æ£æ¥åå¸é¡µé¢çå个å
ç´ æ¯å¦åå¨248 c1=fun_mypublishui_check(self)249 sleep(2)250 if c1==True:251 print('åå¸é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£å¸¸æ¾ç¤º.')252 sleep(1)253 #åå¸254 #driver.find_element_by_ios_predicate('type==XCUIElementTypeButton AND name=="icon camera"').click()255 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon camera"]').click()256 sleep(3)257 #+258 driver.execute_script("mobile: tap", {"touchCount":"1", "x":55, "y":264})259 sleep(2)260 #好261 allow=driver.find_elements_by_accessibility_id('好')262 if len(allow) != 0:263 driver.find_element_by_accessibility_id('好').click()264 sleep(2)265 sleep(1)266 try:267 for i in range(9):268 #driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="compose guide check box defaul"]')[i].click()269 driver.find_elements_by_ios_predicate('name=="compose guide check box defaul"')[i].click()270 sleep(1)271 sleep(1)272 driver.find_element_by_accessibility_id('å®æ(9/9)').click()273 sleep(2)274 word=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')275 sleep(2)276 word.click()277 sleep(1)278 now0=time.strftime('%Y-%m-%d %H_%M_%S')279 word.send_keys('I love Shanghai_è¯è®º_'+now0)280 t0='I love Shanghai_è¯è®º_'+now0281 sleep(1)282 driver.find_element_by_accessibility_id('åå¸').click()283 sleep(9)284 #ios doesn't need to refresh285 #check numbers of pictures and published text here286 title=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,t0)]')287 sleep(2)288 #print(t0)289 if len(title) != 0 :290 print('åå¸å
容çæåæ£æ¥éè¿')291 sleep(1)292 else:293 print('åå¸å
容çæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')294 sleep(1)295 now=time.strftime('%Y-%m-%d %H_%M_%S')296 sf1='../../test_report/ios/'+now+'_errorPublishText_R_stg_tc003.png'297 driver.get_screenshot_as_file(sf1)298 sleep(2)299 number=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="9"]')300 #print(number.text)301 if len(number) != 0:302 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥éè¿')303 sleep(1)304 else:305 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')306 sleep(1)307 now=time.strftime('%Y-%m-%d %H_%M_%S')308 sf2='../../test_report/ios/'+now+'_errorPublishPicture9_R_stg_tc003.png'309 driver.get_screenshot_as_file(sf2)310 sleep(1)311 driver.find_element_by_accessibility_id('all page back black icon').click()312 sleep(1)313 except Exception as e:314 print('åçå¼å¸¸ï¼'+str(e))315 sleep(1)316 pass317 now=time.strftime('%Y-%m-%d %H_%M_%S')318 print('TC_æç_åå¸é¡µé¢å
ç´ æ£æ¥ååå¸åè½----ç»æ:'+now)319#*******************************************************320#TC Name:test_wode_loginmp_tc004321#Purpose:æ£æ¥ç¨æ·ç¨ææºå·+éªè¯ç éæ°ç»å½appçåè½322#OS:iOS323#Device:iPhone7324#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½325#Post-conditions:N/A326#Modify History:created by Sam [2018/08/13]327#*******************************************************328 def test_wode_loginmp_tc004(self):329 driver=self.driver330 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æç页é¢éç¨ææºå·ç éæ°ç»å½ï¼å¦æå·²ç»å½å
éåºè´¦å·----step1æ£æ¥ç¨æ·æ¯å¦å·²ç»ç»å½')331 print('step2å¦æç¨æ·å·²ç»ç»å½åéåºåæ¥è´¦å·ï¼step3éæ©ç¨ææºå·+éªè¯ç ç»å½ï¼step4æ£æ¥ç»å½çè´¦å·æ¯å¦æ£ç¡®')332 now=time.strftime('%Y-%m-%d %H_%M_%S')333 print('客æ·éæ°ç»å½è´¦å·----å¼å§:'+now)334 sleep(1)335 driver.find_element_by_accessibility_id('è¿å').click()336 sleep(1)337 #f=fun_getinfo(self)338 #sleep(2)339 g=bp_is_loggedin(self)340 sleep(2)341 #ç»å½é¡µé¢342 driver.execute_script("mobile: tap", {"touchCount":"1", "x":67, "y":100})343 sleep(1)344 mobile_no=driver.find_elements_by_class_name('XCUIElementTypeTextField')[0]345 mobile_no.click()346 sleep(1)347 mobile_no.send_keys('98762396871')348 sleep(1)349 code=driver.find_elements_by_class_name('XCUIElementTypeTextField')[1]350 code.click()351 sleep(1)352 #code.send_keys(f[1])353 code.send_keys('867129')354 #å®æ355 #driver.find_element_by_accessibility_id('Toolbar Done Button').click()356 sleep(1)357 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="注å/ç»å½"]').click()358 sleep(5)359 driver.find_element_by_accessibility_id('è¿å').click()360 sleep(2)361 #driver.swipe(50,300,50,700,1000)362 #sleep(2)363 name=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="SamSTG"]')364 if len(name) != 0:365 print('ç»å½æåï¼')366 sleep(1)367 else:368 print('ç»å½å¤±è´¥ï¼')369 sleep(1)370 now=time.strftime('%Y-%m-%d %H_%M_%S')371 sf='../../test_report/ios/'+now+'_errornormalLogin_R_stg_tc004.png'372 driver.get_screenshot_as_file(sf)373 sleep(1)374 now=time.strftime('%Y-%m-%d %H_%M_%S')375 print('TC_客æ·éæ°ç»å½è´¦å·----ç»æ:'+now)376#*******************************************************377#TC Name:test_wode_visitor_tc005378#Purpose:æ£æ¥è®¿å®¢æ¨¡å¼ç¹å»æç页é¢å个èåçé¢æå¨ä½379#OS:iOS380#Device:iPhone7381#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½382#Post-conditions:N/A383#Modify History:created by Sam [2018/08/13]384#*******************************************************385 def test_wode_visitor_tc005(self):386 driver=self.driver387 print('TC_访客模å¼ç¹å»æç页é¢å个èåï¼æ£æ¥ç¹:ç¹å»æç页é¢å个èåæ¯å¦è·³è½¬å°ç¨æ·ç»å½é¡µé¢----step1æ£æ¥ç¨æ·æ¯å¦å·²ç»ç»å½')388 print('step2å¦æç¨æ·å·²ç»ç»å½åéåºåæ¥è´¦å·ï¼step3ç¹å»æç页é¢ï¼step4ä»excelæ件读åè¦æ£æ¥çå个èåå称ï¼')389 print('ä¾æ¬¡ç¹å»æ£æ¥æ¯å¦ä¼è·³è½¬å°ç¨æ·ç»å½çé¢;step5ç¹å»å å
¥èæ¥è·³è½¬é¡µé¢æ¯å¦æ£å¸¸æ¾ç¤º;step6ç¹å»è®¾ç½®å¼¹åºé¡µé¢æ¯å¦æ£å¸¸æ¾ç¤º;')390 print('step7ç¨åæ¥è´¦å·åéªè¯ç éæ°ç»å½app')391 now=time.strftime('%Y-%m-%d %H_%M_%S')392 print('æç_访客模å¼ç¹å»æç页é¢å个èå跳转页é¢----å¼å§:'+now)393 sleep(1)394 ret=driver.find_elements_by_accessibility_id('è¿å')395 if len(ret) != 0:396 driver.find_element_by_accessibility_id('è¿å').click()397 sleep(2)398 bp_is_loggedin(self)399 sleep(2)400 #æç401 driver.find_element_by_accessibility_id('æç').click()402 sleep(2)403 menu_name=fun_getloginmenu(self)404 sleep(1)405 driver.execute_script("mobile: dragFromToForDuration",{"fromX":50,"fromY":500,"toX":50,"toY":450,"duration":1.0})406 sleep(2)407 #check the menu by turn408 for j in range(1,9):409 menu=driver.find_element_by_accessibility_id(menu_name[j])410 menu.click()411 sleep(2)412 print('æ£æ¥çèåå称ï¼'+menu_name[j])413 bp_is_loginshow(self)414 driver.find_element_by_accessibility_id('all page back black icon').click()415 sleep(2)416 driver.execute_script("mobile: dragFromToForDuration",{"fromX":50,"fromY":550,"toX":50,"toY":250,"duration":1.0})417 sleep(2)418 #å å
¥èæ¥419 driver.find_element_by_accessibility_id('å å
¥èæ¥').click()420 sleep(9)421 #ææèä½422 tl=driver.find_elements_by_xpath('//XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeOther[4]')423 if len(tl) == 0:424 print('访客模å¼ç¹å»å å
¥èæ¥è·³è½¬é¡µé¢ä¸æ£å¸¸ï¼è¯·æ£æ¥')425 sleep(1)426 now=time.strftime('%Y-%m-%d %H_%M_%S')427 sf0='../../test_report/ios/'+now+'_errorJoinNIO_R_stg_tc005.png'428 driver.get_screenshot_as_file(sf0)429 else:430 print('访客模å¼ç¹å»å å
¥èæ¥è·³è½¬é¡µé¢æ£å¸¸æ¾ç¤º')431 sleep(2)432 driver.find_element_by_accessibility_id('è¿åâèæ¥Testâ').click()433 sleep(2)434 #设置435 driver.find_element_by_accessibility_id('设置').click()436 sleep(2)437 out=driver.find_elements_by_accessibility_id('éåºç»å½')438 if len(out) != 0:439 print('访客模å¼ç¹å»è®¾ç½®è·³è½¬é¡µé¢ä¸æ£å¸¸ï¼è¯·æ£æ¥')440 sleep(1)441 now=time.strftime('%Y-%m-%d %H_%M_%S')442 sf1='../../test_report/ios/'+now+'_errorSettings_R_stg_tc005.png'443 driver.get_screenshot_as_file(sf1)444 else:445 print('访客模å¼ç¹å»è®¾ç½®è·³è½¬é¡µé¢æ£å¸¸æ¾ç¤º')446 sleep(2)447 driver.find_element_by_accessibility_id('all page back black icon').click()448 sleep(2)449 bp_normalloginmp(self)450 sleep(1)451 now=time.strftime('%Y-%m-%d %H_%M_%S')452 print('TC_æç_访客模å¼ç¹å»æç页é¢å个èå跳转页é¢----ç»æ:'+now)453#*******************************************************454#TC Name:test_faxian_publishnow_tc006455#Purpose:æ£æ¥åç°é¡µé¢çåå¸åè½456#OS:iOS457#Device:iPhone7458#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app459#Post-conditions:N/A460#Modify History:created by Sam [2018/08/17]461#*******************************************************462 def test_faxian_publishnow_tc006(self):463 driver=self.driver464 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åå¸æ¤å»åè½----step1æ£æ¥åç°é¦é¡µå³ä¸è§+å·æ¯å¦åå¨')465 print('step2æ£æ¥åå¸æ¤å»æé®æ¯å¦åå¨ï¼step3åå¸åè½æ¯å¦æ£å¸¸ï¼step4æ£æ¥åå¸å
容éæ¯å¦å¯ä»¥ä¸æ¬¡æ大ä¸ä¼ 9å¼ å¾ç')466 print('step5æ£æ¥åå¸æåæ¯å¦æ£ç¡®')467 now=time.strftime('%Y-%m-%d %H_%M_%S')468 print('TC_åç°_åå¸æ¤å»----å¼å§:'+now)469 sleep(1)470 driver.find_element_by_accessibility_id('è¿å').click()471 sleep(2)472 #åç°473 #driver.find_element_by_accessibility_id('åç°').click()474 #sleep(2)475 c1=bp_is_plusexist(self)476 if c1 == True:477 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="addPopMenu"]').click()478 sleep(2)479 #åæ¤å»480 c2=bp_is_publishnowexist(self)481 if c2 == True:482 driver.find_element_by_accessibility_id('åæ¤å»').click()483 sleep(2)484 #driver.find_element_by_xpath('//xxxx').click()485 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':55, 'y':264})486 sleep(3)487 #好488 allow=driver.find_elements_by_accessibility_id('好')489 if len(allow) != 0:490 driver.find_element_by_accessibility_id('好').click()491 sleep(2)492 try:493 for i in range(9):494 driver.find_elements_by_ios_predicate('name=="compose guide check box defaul"')[i].click()495 sleep(1)496 sleep(1)497 driver.find_element_by_accessibility_id('å®æ(9/9)').click()498 sleep(3)499 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')500 sleep(2)501 if len(words) != 0:502 words[0].click()503 sleep(1)504 now0=time.strftime('%Y-%m-%d %H_%M_%S')505 words[0].send_keys('I love Shanghai:'+now0)506 t0='I love Shanghai:'+now0507 sleep(1)508 print(t0)509 driver.find_element_by_accessibility_id('åå¸').click()510 sleep(6)511 #check numbers of pictures and published text here512 title=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,t0)]')513 sleep(2)514 if len(title) != 0:515 print('åå¸å
容çæåæ£æ¥éè¿')516 sleep(1)517 else:518 print('åå¸å
容çæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')519 sleep(1)520 now=time.strftime('%Y-%m-%d %H_%M_%S')521 sf1='../../test_report/ios/'+now+'_errorText_R_stg_tc006.png'522 driver.get_screenshot_as_file(sf1)523 sleep(2)524 number=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="9"]')525 if len(number) != 0:526 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥éè¿')527 sleep(1)528 else:529 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')530 sleep(1)531 now=time.strftime('%Y-%m-%d %H_%M_%S')532 sf2='../../test_report/ios/'+now+'_errorPic9_R_stg_tc006.png'533 driver.get_screenshot_as_file(sf2)534 sleep(2)535 else:536 print('åå¸æåæ¡æ²¡æè·åï¼è¯·éæ°å°è¯')537 sleep(2)538 except Exception as e:539 print('åçå¼å¸¸ï¼'+str(e))540 sleep(1)541 pass542 now=time.strftime('%Y-%m-%d %H_%M_%S')543 print('TC_åç°_åå¸æ¤å»----ç»æ:'+now)544#*******************************************************545#TC Name:test_wode_deletepublished_tc007546#Purpose:æ£æ¥æç页é¢çå é¤å·²åå¸å
容çåè½547#OS:iOS548#Device:iPhone7549#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app550#Post-conditions:N/A551#Modify History:created by Sam [2018/08/17]552#*******************************************************553 def test_wode_deletepublished_tc007(self):554 driver=self.driver555 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æçââå é¤å·²åå¸çå
容---step1ç¹å»æç页é¢åå¸;step2æ£æ¥æ¯å¦æå·²åå¸çå
容,')556 print('æçè¯ç¹å»å®è¿å
¥è¯¦ç»é¡µé¢åç¹å»å³ä¸è§æé®ï¼æ§è¡å é¤å¨ä½;step3æ£æ¥è¢«å é¤çåå¸å
容æ¯å¦å é¤æå')557 now=time.strftime('%Y-%m-%d %H_%M_%S')558 print('æç_å é¤å·²åå¸çå
容----å¼å§:'+now)559 sleep(2)560 driver.find_element_by_accessibility_id('è¿å').click()561 sleep(2)562 #æç563 driver.find_element_by_accessibility_id('æç').click()564 sleep(2)565 driver.find_element_by_accessibility_id('åå¸').click()566 #driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[3]').click()567 sleep(3)568 p=driver.find_elements_by_class_name('XCUIElementTypeCell')569 if len(p) != 0:570 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="SamSTG"]')[0].click()571 sleep(2)572 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()573 sleep(1)574 #å é¤575 driver.find_element_by_accessibility_id('å é¤').click()576 sleep(1)577 #确认578 driver.find_element_by_accessibility_id('确认').click()579 sleep(1)580 ch=driver.find_elements_by_accessibility_id('å é¤æå')581 if len(ch) == 0:582 print('åå¸çå
容å é¤å¤±è´¥ï¼è¯·æ£æ¥åå ')583 sleep(1)584 now=time.strftime('%Y-%m-%d %H_%M_%S')585 sf1='../../test_report/ios/'+now+'_errorDeleted_R_stg_tc007.png'586 driver.get_screenshot_as_file(sf1)587 else:588 print('åå¸çå
容å é¤æå')589 sleep(1)590 else:591 print('没æå·²åå¸çå
容å¯ä»¥å é¤ï¼')592 sleep(1)593 driver.find_element_by_accessibility_id('all page back black icon').click()594 sleep(2)595 now=time.strftime('%Y-%m-%d %H_%M_%S')596 print('TC_æç_å é¤å·²åå¸çå
容----ç»æ:'+now)597#*******************************************************598#TC Name:test_wode_loginwechat_tc008599#Purpose:æ£æ¥ç¨æ·è½å¦ç¨å¾®ä¿¡è´¦å·ç»å½app600#OS:iOS601#Device:iPhone7602#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app603#Post-conditions:N/A604#Modify History:created by Sam [2018/08/17]605#*******************************************************606 def test_wode_loginwechat_tc008(self):607 driver=self.driver608 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æç页é¢éç¨å¾®ä¿¡ç»å½ï¼å¦æå·²ç»å½å
éåºè´¦å·----step1æ£æ¥ç¨æ·æ¯å¦å·²ç»ç»å½ï¼')609 print('step2å¦æç¨æ·å·²ç»ç»å½åéåºåæ¥è´¦å·ï¼step3éæ©ç¨å¾®ä¿¡ç»å½ï¼step4æ£æ¥å¾®ä¿¡ç»å½çè´¦å·æ¯å¦æ£ç¡®')610 now=time.strftime('%Y-%m-%d %H_%M_%S')611 print('TC_æç_客æ·ç¨å¾®ä¿¡ç»å½è´¦å·----å¼å§:'+now)612 sleep(1)613 driver.find_element_by_accessibility_id('è¿å').click()614 sleep(1)615 g=bp_is_loggedin(self)616 sleep(1)617 #ç»å½é¡µé¢618 driver.find_element_by_accessibility_id('注å/ç»å½').click()619 sleep(1)620 #微信ç»å½621 btn=driver.find_elements_by_accessibility_id('log in wechat icon')622 if len(btn) != 0:623 print('微信ç»å½æé®åå¨')624 driver.find_element_by_accessibility_id('log in wechat icon').click()625 sleep(3)626 driver.find_element_by_accessibility_id('è¿å').click()627 sleep(3)628 #driver.find_element_by_accessibility_id('确认ç»å½').click()629 #sleep(5)630 name=driver.find_elements_by_accessibility_id('SamSTG')631 if len(name) != 0:632 print('微信ç»å½æåï¼')633 sleep(1)634 else:635 print('微信ç»å½å¤±è´¥ï¼')636 sleep(1)637 now=time.strftime('%Y-%m-%d %H_%M_%S')638 sf0='../../test_report/ios/'+now+'_errorLoginWechat_R_stg_tc008.png'639 driver.get_screenshot_as_file(sf0)640 sleep(1)641 else:642 print('微信ç»å½æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')643 sleep(1)644 now=time.strftime('%Y-%m-%d %H_%M_%S')645 sf1='../../test_report/ios/'+now+'_errorNoButton_R_stg_tc008.png'646 driver.get_screenshot_as_file(sf1)647 sleep(2)648 now=time.strftime('%Y-%m-%d %H_%M_%S')649 print('TC_æç_客æ·ç¨å¾®ä¿¡ç»å½è´¦å·----ç»æ:'+now)650#*******************************************************651#TC Name:test_wode_loginwebo_tc009652#Purpose:æ£æ¥ç¨æ·è½å¦ç¨å¾®åè´¦å·ç»å½app653#OS:iOS654#Device:iPhone7655#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app656#Post-conditions:N/A657#Modify History:created by Sam [2018/08/17]658#*******************************************************659 def test_wode_loginwebo_tc009(self):660 driver=self.driver661 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æç页é¢éç¨å¾®åç»å½ï¼å¦æå·²ç»å½å
éåºè´¦å·----step1æ£æ¥ç¨æ·æ¯å¦å·²ç»ç»å½ï¼')662 print('step2å¦æç¨æ·å·²ç»ç»å½åéåºåæ¥è´¦å·ï¼step3éæ©ç¨å¾®åç»å½ï¼step4æ£æ¥å¾®åç»å½çè´¦å·æ¯å¦æ£ç¡®')663 now=time.strftime('%Y-%m-%d %H_%M_%S')664 print('TC_æç_客æ·ç¨å¾®åç»å½è´¦å·----å¼å§:'+now)665 sleep(1)666 driver.find_element_by_accessibility_id('è¿å').click()667 sleep(1)668 g=bp_is_loggedin(self)669 sleep(2)670 #ç»å½é¡µé¢671 driver.find_element_by_accessibility_id('注å/ç»å½').click()672 sleep(1)673 #å¾®åç»å½674 btn=driver.find_elements_by_accessibility_id('log in microblog icon')675 if len(btn) != 0:676 print('å¾®åç»å½æé®åå¨')677 driver.find_element_by_accessibility_id('log in microblog icon').click()678 sleep(5)679 driver.find_element_by_accessibility_id('确认').click()680 sleep(2)681 driver.find_element_by_accessibility_id('è¿å').click()682 sleep(2)683 name=driver.find_elements_by_accessibility_id('SamSTG')684 if len(name) != 0:685 print('å¾®åç»å½æåï¼')686 sleep(1)687 else:688 print('å¾®åç»å½å¤±è´¥ï¼')689 sleep(1)690 now=time.strftime('%Y-%m-%d %H_%M_%S')691 sf0='../../test_report/ios/'+now+'_errorLoginWebo_R_stg_tc009.png'692 driver.get_screenshot_as_file(sf0)693 else:694 print('å¾®åç»å½æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')695 now=time.strftime('%Y-%m-%d %H_%M_%S')696 sf1='../../test_report/ios/'+now+'_errorNoButton_R_stg_tc009.png'697 driver.get_screenshot_as_file(sf1)698 sleep(2)699 now=time.strftime('%Y-%m-%d %H_%M_%S')700 print('TC_æç_客æ·ç¨å¾®åç»å½è´¦å·----ç»æ:'+now)701#*******************************************************702#TC Name:test_faxian_tabcheck_tc010703#Purpose:æ£æ¥åç°é¡µé¢tabä¸å
ç´ åæ¨èãæ¤å»åtab页ä¸å
ç´ æ¯å¦åå¨704#OS:iOS705#Device:iPhone7706#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app707#Post-conditions:N/A708#Modify History:created by Sam [2018/08/16]709#*******************************************************710 def test_faxian_tabcheck_tc010(self):711 driver=self.driver712 print('TC_æ£æ¥ç¨æ·æ¨¡å¼æå¼APPï¼æ£æ¥ç¹:åç°_tabUIæ£æ¥åè½----step1æ£æ¥åç°é¡µé¢tabä¸ååtabå
ç´ æ¯å¦åå¨;')713 print('step2æ£æ¥æ¨èåtab页ä¸åå
ç´ æ¯å¦åå¨;step3æ£æ¥æ¤å»åtab页ä¸åå
ç´ æ¯å¦åå¨')714 now=time.strftime('%Y-%m-%d %H_%M_%S')715 print('TC_åç°_tabä¸å
ç´ åæ¨èãæ¤å»åtab页ä¸å
ç´ æ£æ¥----å¼å§:'+now)716 sleep(1)717 driver.find_element_by_accessibility_id('è¿å').click()718 sleep(2)719 for i in range(6):720 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':51,'duration':1.0})721 sleep(2)722 driver.execute_script("mobile: scroll", {"direction": "down"})723 sleep(2)724 #æ£æ¥åç°é¡µé¢çå个å
ç´ æ¯å¦åå¨725 c1=fun_findui_check(self)726 if c1 == True:727 print('åç°é¡µé¢tabä¸ååtabå
ç´ æ£æ¥éè¿')728 else:729 print('åç°é¡µé¢tabä¸ååtabå
ç´ æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')730 sleep(2)731 now=time.strftime('%Y-%m-%d %H_%M_%S')732 print('TC_åç°_tabä¸å
ç´ åæ¨èãæ¤å»åtab页ä¸å
ç´ æ£æ¥----ç»æ:'+now)733#*******************************************************734#TC Name:test_wode_personalinfo_tc011735#Purpose:æç个人信æ¯é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥736#OS:iOS737#Device:iPhone7738#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app739#Post-conditions:N/A740#Modify History:created by Sam [2018/08/16]741#*******************************************************742 def test_wode_personalinfo_tc011(self):743 driver=self.driver744 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:个人信æ¯é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----step1è¿å
¥ä¸ªäººä¿¡æ¯é¡µé¢ï¼')745 print('step2个人信æ¯é¡µé¢ä¸å
ç´ UIæ£æ¥;step3æ£æ¥ç¹å»å¤´åçåè½;step4æ£æ¥æµç§°åç®ç§°æ¯å¦å¯ä»¥ç¼è¾;step5æ£æ¥æ§å«æ¯å¦')746 print('å¯ä»¥æ¹å;step6æ£æ¥å¸¸é©»å°åºé¡µé¢æ¯å¦å¯ä»¥è¿å
¥;step7æ£æ¥å°å管ç页é¢æ¯å¦å¯ä»¥è¿å
¥;step8æ£æ¥ç¨æ·éç§æ¡æ¬¾é¡µé¢')747 print('æ¯å¦å¯ä»¥è¿å
¥;step9æ£æ¥ä¿®æ¹ç个人信æ¯æ¯å¦å¯ä»¥ä¿åæå')748 now=time.strftime('%Y-%m-%d %H_%M_%S')749 print('TC_æçââ个人信æ¯é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----å¼å§:'+now)750 sleep(2)751 driver.find_element_by_accessibility_id('è¿å').click()752 sleep(2)753 #æç754 driver.find_element_by_accessibility_id('æç').click()755 sleep(3)756 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="SamSTG"]').click()757 sleep(4)758 #ç¼è¾ä¸ªäººä¿¡æ¯759 driver.find_element_by_accessibility_id('ç¼è¾ä¸ªäººä¿¡æ¯').click()760 sleep(2)761 #æ£æ¥åå¸é¡µé¢çå个å
ç´ æ¯å¦åå¨762 c1=fun_personalinfoui_check(self)763 sleep(2)764 if c1 == True:765 print('个人信æ¯é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£å¸¸æ¾ç¤º.')766 sleep(1)767 #ç¹å»å¤´å768 head=driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeButton')769 head.click()770 sleep(2)771 #æç
§772 ph=driver.find_elements_by_accessibility_id('æç
§')773 if len(ph) != 0:774 print('æç
§æé®åå¨')775 driver.find_element_by_accessibility_id('æç
§').click()776 sleep(1)777 #好778 allow=driver.find_elements_by_accessibility_id('好')779 if len(allow) != 0:780 driver.find_element_by_accessibility_id('好').click()781 sleep(2)782 phbtn=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="PhotoCapture"]')783 if len(phbtn) != 0:784 print('ææºç¸æºå·²æ£å¸¸å¼¹åº')785 sleep(1)786 else:787 print('ææºç¸æºæ²¡ææ£å¸¸å¼¹åºï¼è¯·æ£æ¥åå ')788 sleep(1)789 driver.find_element_by_accessibility_id('åæ¶').click()790 sleep(1)791 else:792 print('æç
§æé®ä¸åå¨ï¼è¯·æ£æ¥')793 sleep(2)794 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeButton').click()795 sleep(2)796 #ä»ææºç¸åéæ©797 pic=driver.find_elements_by_accessibility_id('ä»ææºç¸åéæ©')798 if len(pic) != 0:799 print('ä»ææºç¸åéæ©æé®åå¨')800 driver.find_element_by_accessibility_id('ä»ææºç¸åéæ©').click()801 sleep(1)802 #好803 allow=driver.find_elements_by_accessibility_id('好')804 if len(allow) != 0:805 driver.find_element_by_accessibility_id('好').click()806 sleep(2)807 picbtn=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç
§ç"]')808 if len(picbtn) != 0:809 print('ææºç¸åå¯ä»¥æ£å¸¸è°ç¨')810 sleep(1)811 else:812 print('ææºç¸åä¸å¯ä»¥æ£å¸¸è°ç¨ï¼è¯·æ£æ¥åå ')813 sleep(1)814 driver.find_element_by_accessibility_id('åæ¶').click()815 sleep(1)816 else:817 print('ä»ææºç¸åéæ©æé®ä¸åå¨ï¼è¯·æ£æ¥')818 sleep(2)819 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeButton').click()820 sleep(2)821 #åæ¶822 can=driver.find_elements_by_accessibility_id('åæ¶')823 if len(can) != 0:824 print('åæ¶æé®åå¨')825 driver.find_element_by_accessibility_id('åæ¶').click()826 sleep(2)827 else:828 print('åæ¶æé®ä¸åå¨ï¼è¯·æ£æ¥')829 sleep(2)830 #æµç§°831 nick=driver.find_element_by_xpath('//XCUIElementTypeTextField[@value="SamSTG"]')832 nick.click()833 sleep(1)834 #focused=true;835 c1=driver.find_elements_by_accessibility_id('æ¸
é¤ææ¬')836 if len(c1) != 0:837 print('æµç§°å¯ä»¥è¢«ç¼è¾')838 else:839 print('æµç§°ä¸å¯ä»¥è¢«ç¼è¾ï¼è¯·æ£æ¥åå ')840 sleep(2)841 driver.find_element_by_accessibility_id('æ¸
é¤ææ¬').click()842 sleep(1)843 driver.find_element_by_accessibility_id('all page back black icon').click()844 sleep(1)845 driver.find_element_by_accessibility_id('ç¡®å®').click()846 sleep(2)847 #ç¼è¾ä¸ªäººä¿¡æ¯848 driver.find_element_by_accessibility_id('ç¼è¾ä¸ªäººä¿¡æ¯').click()849 sleep(2)850 #ç®ä»851 intro=driver.find_element_by_xpath('//XCUIElementTypeTextField[@value="Sam_STG"]')852 intro.click()853 sleep(1)854 c2=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="æ¸
é¤ææ¬"]')855 if len(c2) != 0:856 print('ç®ä»å¯ä»¥è¢«ç¼è¾')857 else:858 print('ç®ä»ä¸å¯ä»¥è¢«ç¼è¾ï¼è¯·æ£æ¥åå ')859 sleep(1)860 #å®æ861 driver.execute_script("mobile: tap", {"touchCount":"1", "x":331, "y":382})862 sleep(1)863 #æ§å«864 man=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="default address not choose"]')[0]865 woman=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="default address not choose"]')[1]866 #checked=true867 c_man=man.get_attribute('value')868 c_woman=woman.get_attribute('value')869 if c_man == '1':870 woman.click()871 sleep(1)872 print('ç¨æ·æ§å«å¯ä»¥ä»ç·æ¹åæ女')873 sleep(1)874 else:875 man.click()876 sleep(1)877 print('ç¨æ·æ§å«å¯ä»¥ä»å¥³æ¹åæç·')878 sleep(2)879 #å°åº880 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å°åº"]').click()881 sleep(3)882 ct=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="天津å¸"]')883 if len(ct) != 0:884 print('常驻å°åºé¡µé¢å¯ä»¥è¿å
¥')885 else:886 print('常驻å°åºé¡µé¢ä¸å¯ä»¥è¿å
¥ï¼è¯·æ£æ¥åå ')887 sleep(1)888 driver.find_element_by_accessibility_id('all page back black icon').click()889 sleep(2)890 #æçå°å891 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="æçå°å"]').click()892 sleep(3)893 addr=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="é»è®¤å°å"]')894 if len(addr) != 0:895 print('å°å管ç页é¢å¯ä»¥è¿å
¥')896 else:897 print('å°å管ç页é¢æ²¡æé»è®¤å°åï¼è¯·æ·»å æ°å°å')898 sleep(1)899 driver.find_element_by_accessibility_id('all page back black icon').click()900 sleep(2)901 #ä¿å902 #driver.find_element_by_xpath('//XCUIElementTypeButton[@name="ä¿å"]').click()903 driver.find_element_by_accessibility_id('ä¿å').click()904 sleep(1)905 save=driver.find_elements_by_accessibility_id('ä¿åæå')906 if len(save) != 0:907 print('----ä¿®æ¹ç个人信æ¯å¯ä»¥ä¿åæå')908 sleep(1)909 else:910 print('----ä¿®æ¹ç个人信æ¯æ²¡æä¿åæåï¼è¯·æ£æ¥')911 sleep(1)912 now=time.strftime('%Y-%m-%d %H_%M_%S')913 sf='../../test_report/ios/'+now+'_errorSaveInfo_R_tc011.png'914 driver.get_screenshot_as_file(sf)915 sleep(2)916 driver.find_element_by_accessibility_id('all page back black icon').click()917 sleep(2)918 now=time.strftime('%Y-%m-%d %H_%M_%S')919 print('TC_æçââ个人信æ¯é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----ç»æ:'+now)920#*******************************************************921#TC Name:test_jingxi_products_tc013922#Purpose:æå页é¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥923#OS:iOS924#Device:iPhone7925#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app926#Post-conditions:N/A927#Modify History:created by Sam [2018/11/08]928#*******************************************************929 def test_jingxi_products_tc013(self):930 driver=self.driver931 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå页é¢ä¸å
ç´ UIæ£æ¥----step1æå页é¢ä¸ä»»æ礼åçå
ç´ UIæ£æ¥')932 now=time.strftime('%Y-%m-%d %H_%M_%S')933 print('TC_æåââæå页é¢ä¸å
ç´ UIæ£æ¥----å¼å§:'+now)934 sleep(1)935 driver.find_element_by_accessibility_id('è¿å').click()936 sleep(1)937 #æå938 driver.find_element_by_accessibility_id('æå').click()939 sleep(8)940 for i in range(1):941 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':350,'duration':1.0})942 sleep(2)943 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':350,'duration':1.0})944 sleep(2)945 #æå页é¢çå个å
ç´ æ¯å¦åå¨946 c1=fun_giftui_check(self)947 sleep(2)948 if c1 == True:949 print('积åæç»é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£æ¥å®æ¯')950 sleep(2)951 now=time.strftime('%Y-%m-%d %H_%M_%S')952 print('TC_æåââæå页é¢ä¸å
ç´ UIæ£æ¥----ç»æ:'+now)953#*******************************************************954#TC Name:test_wode_instuninstversioncheck_tc015955#Purpose:æç积åæç»é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥956#OS:iOS957#Device:iPhone7958#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app959#Post-conditions:N/A960#Modify History:created by Sam [2018/08/16]961#*******************************************************962 def test_wode_instuninstversioncheck_tc015(self):963 driver=self.driver964 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å
¼å®¹æ§æµè¯ï¼å®è£
åå¸è½½appåè½----step1å¸è½½app')965 print('step2æ£æ¥appæ¯å¦åå¨ï¼step3éæ°å®è£
appï¼step4æ£æ¥appæ¯ä¸æ¯ææ°/æéçæ¬')966 now=time.strftime('%Y-%m-%d %H_%M_%S')967 print('TC_å
¼å®¹æ§æµè¯ï¼å®è£
åå¸è½½appåè½----å¼å§:'+now)968 sleep(2)969 driver.find_element_by_accessibility_id('è¿å').click()970 sleep(2)971 #home972 #driver.find_element_by_accessibility_id('æç').click()973 #sleep(2)974 #å¸è½½app975 driver.remove_app('com.do1.WeiLaiApp.inhouse')976 sleep(3)977 #check if app is uninstalled978 c=driver.is_app_installed('com.do1.WeiLaiApp.inhouse')979 sleep(1)980 if c == True:981 print('å¸è½½èæ¥app失败ï¼è¯·æ£æ¥åå ')982 else:983 print('å¸è½½èæ¥appæå')984 sleep(2)985 #install app986 d=os.path.abspath(os.path.join(os.getcwd(), "../.."))987 driver.install_app(d+'/test_data/app/ios_package/NextevCarInhouseQA.ipa')988 sleep(3)989 driver.launch_app()990 sleep(5)991 #å
许992 allow=driver.find_elements_by_accessibility_id('å
许')993 if len(allow) != 0:994 driver.find_element_by_accessibility_id('å
许').click()995 sleep(2)996 allow=driver.find_elements_by_accessibility_id('å
许')997 if len(allow) != 0:998 driver.find_element_by_accessibility_id('å
许').click()999 sleep(2)1000 #æç1001 driver.find_element_by_accessibility_id('æç').click()1002 sleep(2)1003 self.driver.execute_script("mobile: scroll", {"direction": "down"})1004 sleep(2)1005 #设置1006 driver.find_element_by_accessibility_id('设置').click()1007 sleep(2)1008 n=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="3.0.5 build:2077"]')1009 if len(n) != 0:1010 print('éæ°å®è£
appåçæ¬æ£æ¥éè¿')1011 sleep(1)1012 else:1013 print('éæ°å®è£
appåçæ¬æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1014 sleep(1)1015 now=time.strftime('%Y-%m-%d %H_%M_%S')1016 sf='../../test_report/ios/'+now+'_errorVersonCheck_R_tc015.png'1017 driver.get_screenshot_as_file(sf)1018 sleep(2)1019 now=time.strftime('%Y-%m-%d %H_%M_%S')1020 print('TC_å
¼å®¹æ§æµè¯ï¼å®è£
åå¸è½½appåè½----ç»æ:'+now)1021#*******************************************************1022#TC Name:test_wode_scores_tc0161023#Purpose:æç积åæç»é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥1024#OS:iOS1025#Device:iPhone71026#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1027#Post-conditions:N/A1028#Modify History:created by Sam [2018/08/16]1029#*******************************************************1030 def test_wode_scores_tc016(self):1031 driver=self.driver1032 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:积åæç»é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----step1è¿å
¥ç§¯åæç»é¡µé¢ï¼')1033 print('step2页é¢ä¸å
ç´ UIæ£æ¥;step3æ£æ¥ç¹å»ç§¯åè§åæé®çåè½')1034 now=time.strftime('%Y-%m-%d %H_%M_%S')1035 print('TC_æçââ积åæç»é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----å¼å§:'+now)1036 sleep(2)1037 driver.find_element_by_accessibility_id('è¿å').click()1038 sleep(2)1039 #æç1040 driver.find_element_by_accessibility_id('æç').click()1041 sleep(3)1042 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[2]').click()1043 sleep(3)1044 #æ£æ¥ç§¯åæç»é¡µé¢çå个å
ç´ æ¯å¦åå¨1045 c1=fun_scoredetailui_check(self)1046 sleep(2)1047 if c1 == True:1048 print('积åæç»é¡µé¢ä¸å个被æ£æ¥å
ç´ é½æ£æ¥å®æ¯')1049 sleep(1)1050 #ç¹å»ï¼å·1051 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="integration rule"]').click()1052 sleep(3)1053 #æç
§1054 t=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="积åè§å"]')1055 if len(t) != 0:1056 print('积åè§å页é¢åå¨')1057 sleep(1)1058 else:1059 print('积åè§å页é¢ä¸åå¨ï¼è¯·æ£æ¥')1060 sleep(1)1061 driver.find_element_by_accessibility_id('all page back black icon').click()1062 sleep(2)1063 driver.find_element_by_accessibility_id('all page back black icon').click()1064 sleep(2)1065 now=time.strftime('%Y-%m-%d %H_%M_%S')1066 print('TC_æçââ积åæç»é¡µé¢ä¸å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥----ç»æ:'+now)1067#*******************************************************1068#TC Name:test_pengyou_remarkfriend_tc0181069#Purpose:æå页é¢å¯¹å¥½å设置å¤æ³¨å¹¶æ£æ¥å¤æ³¨æ¯å¦çæ1070#OS:iOS1071#Device:iPhone71072#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1073#Post-conditions:N/A1074#Modify History:created by Sam [2018/08/20]1075#*******************************************************1076 def test_pengyou_remarkfriend_tc018(self):1077 driver=self.driver1078 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:对好å设置å¤æ³¨å¹¶æ£æ¥å¤æ³¨æ¯å¦çæ----step1ä»æå页é¢è¿å
¥æåå表页é¢')1079 print('step2éæ©ä¸ä¸ªæåè¿å
¥æå详ç»ä¿¡æ¯é¡µé¢ï¼step3æ£æ¥ç¹å»è®¾ç½®å¤æ³¨æé®çåè½;step4æ£æ¥å¤æ³¨æ¯å¦çæ')1080 now=time.strftime('%Y-%m-%d %H_%M_%S')1081 print('TC_æåââ对好å设置å¤æ³¨å¹¶æ£æ¥å¤æ³¨æ¯å¦çæçåè½æ£æ¥----å¼å§:'+now)1082 sleep(1)1083 driver.find_element_by_accessibility_id('è¿å').click()1084 sleep(1)1085 #æå1086 driver.find_element_by_accessibility_id('æå').click()1087 sleep(5)1088 driver.find_element_by_xpath('//XCUIElementTypeNavigationBar[@name="æå"]/XCUIElementTypeButton').click()1089 sleep(2)1090 f=driver.find_elements_by_class_name('XCUIElementTypeCell')1091 sleep(2)1092 if len(f) >= 1:1093 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()1094 sleep(3)1095 old=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].text1096 sleep(1)1097 driver.find_element_by_accessibility_id('icon more white').click()1098 sleep(2)1099 combtn=driver.find_elements_by_accessibility_id('设置å¤æ³¨')1100 sleep(1)1101 if len(combtn) != 0:1102 driver.find_element_by_accessibility_id('设置å¤æ³¨').click()1103 sleep(2)1104 edit=driver.find_element_by_class_name('XCUIElementTypeTextField')1105 edit.click()1106 sleep(1)1107 edit.clear()1108 sleep(1)1109 edit.send_keys(old+'çå¤æ³¨')1110 sleep(1)1111 driver.find_element_by_accessibility_id('ä¿å').click()1112 sleep(3)1113 #print(old)1114 #print(old+'çå¤æ³¨')1115 cc=driver.find_elements_by_accessibility_id(old+'çå¤æ³¨')1116 sleep(2)1117 if len(cc) != 0:1118 print('好åçå¤æ³¨è®¾ç½®å·²ç»çæ')1119 sleep(1)1120 else:1121 print('好åçå¤æ³¨è®¾ç½®æ²¡æçæï¼è¯·æ£æ¥åå ')1122 sleep(1)1123 now=time.strftime('%Y-%m-%d %H_%M_%S')1124 sf1='../../test_report/ios/'+now+'_errorRemark_R_stg_tc018.png'1125 driver.get_screenshot_as_file(sf1)1126 sleep(2) 1127 else:1128 print('设置å¤æ³¨çæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')1129 sleep(1)1130 now=time.strftime('%Y-%m-%d %H_%M_%S')1131 sf2='../../test_report/ios/'+now+'_errorNoRemark_R_stg_tc018.png'1132 driver.get_screenshot_as_file(sf2)1133 sleep(1)1134 driver.find_element_by_accessibility_id('åæ¶').click()1135 sleep(2)1136 driver.find_element_by_accessibility_id('full screen back icon').click()1137 sleep(2)1138 driver.find_element_by_accessibility_id('all page back black icon').click()1139 sleep(2)1140 else:1141 print('没æ好åå¯ä»¥è®¾ç½®å¤æ³¨ï¼è¯·å
æ·»å 好å')1142 sleep(1)1143 now=time.strftime('%Y-%m-%d %H_%M_%S')1144 sf3='../../test_report/ios/'+now+'_errorNoFriend_R_tc018.png'1145 driver.get_screenshot_as_file(sf3)1146 sleep(2)1147 now=time.strftime('%Y-%m-%d %H_%M_%S')1148 print('TC_æåââ对好å设置å¤æ³¨å¹¶æ£æ¥å¤æ³¨æ¯å¦çæçåè½æ£æ¥----ç»æ:'+now)1149#*******************************************************1150#TC Name:test_faxian_article_tc0191151#Purpose:åç°é¡µé¢æ¨ètabéæç« å
ç´ UIæ£æ¥åç¸å
³å
ç´ çåè½æ£æ¥1152#OS:iOS1153#Device:iPhone71154#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1155#Post-conditions:N/A1156#Modify History:created by Sam [2018/08/23]1157#*******************************************************1158 def test_faxian_article_tc019(self):1159 driver=self.driver1160 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°é¡µé¢æ¨ètabéæç« å
ç´ UIæ£æ¥åè¯è®ºçåè½æ£æ¥----step1ä»åç°é¡µé¢æ¨ètab页æ¾å°ä¸ä¸ªæç« ')1161 print('step2æç« è¯¦æ
页é¢ä¸å
ç´ UIæ£æ¥;step3æ£æ¥ç¹å»è¯è®ºæé®çåè½;step4æ£æ¥å表è¯è®ºæååæç« è¯¦æ
顶é¨çè¯è®ºå
容')1162 now=time.strftime('%Y-%m-%d %H_%M_%S')1163 print('TC_åç°ââæ¨ètabéæç« å
ç´ UIæ£æ¥åè¯è®ºçåè½æ£æ¥----å¼å§:'+now)1164 sleep(1)1165 driver.find_element_by_accessibility_id('è¿å').click()1166 sleep(2)1167 #åç°1168 #driver.find_element_by_accessibility_id('åç°').click()1169 #sleep(2)1170 for i in range(6):1171 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':51,'duration':1.0})1172 sleep(2)1173 driver.execute_script("mobile: scroll", {"direction": "down"})1174 sleep(2)1175 #æ£æ¥æç« çå个å
ç´ æ¯å¦åå¨1176 c1=fun_articleui_check(self)1177 sleep(2)1178 if c1 == True:1179 print('æ¨ètabéæç« å个被æ£æ¥å
ç´ é½æ£æ¥å®æ¯')1180 sleep(2)1181 #ç¹å»è¯è®º1182 driver.find_element_by_xpath('//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[7]/XCUIElementTypeButton[3]').click()1183 sleep(3)1184 #driver.find_element_by_accessibility_id('åè¯è®º').click()1185 driver.find_element_by_xpath('//XCUIElementTypeStaticText[contains(@name,"æä¹æ¥è¯´~")]').click()1186 sleep(2)1187 combtn=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')1188 combtn.click()1189 sleep(1)1190 now0=time.strftime('%Y-%m-%d %H_%M_%S')1191 combtn.send_keys('æç¨Pythonè¯è®ºæç« :'+now0)1192 sleep(1)1193 t0='æç¨Pythonè¯è®ºæç« :'+now01194 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="Send"]').click()1195 sleep(3)1196 #check published text here1197 title=driver.find_elements_by_xpath('//XCUIElementTypeTextView[contains(@value,t0)]')1198 #print(len(title))1199 if len(title) != 0:1200 print('è¯è®ºçæåæ£æ¥éè¿')1201 sleep(1)1202 else:1203 print('è¯è®ºçæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1204 sleep(1)1205 now=time.strftime('%Y-%m-%d %H_%M_%S')1206 sf1='../../test_report/ios/'+now+'_errorComment_R_stg_tc019.png'1207 driver.get_screenshot_as_file(sf1)1208 sleep(2)1209 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="all page back grey icon"]').click()1210 sleep(2)1211 now=time.strftime('%Y-%m-%d %H_%M_%S')1212 print('TC_åç°ââæ¨ètabéæç« å
ç´ UIæ£æ¥åè¯è®ºçåè½æ£æ¥----ç»æ:'+now)1213#*******************************************************1214#TC Name:test_faxian_openmultichat_tc0201215#Purpose:åç°é¡µé¢å起群èåè½çåè½æ£æ¥1216#OS:iOS1217#Device:iPhone71218#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1219#Post-conditions:N/A1220#Modify History:created by Sam [2018/08/20]1221#*******************************************************1222 def test_faxian_openmultichat_tc020(self):1223 driver=self.driver1224 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°é¦é¡µ_å起群èåè½---step1æ£æ¥åç°é¦é¡µå³ä¸è§+å·æ¯å¦åå¨ï¼')1225 print('step2æ£æ¥ç¹å»+å·åå起群èæé®æ¯å¦åå¨ï¼step3å起群è并åéå
容åè½æ¯å¦æ£å¸¸ï¼step4æ£æ¥åå¸å
容éæåæ¯å¦æ£ç¡®')1226 now=time.strftime('%Y-%m-%d %H_%M_%S')1227 print('åç°_å起群èåè½----å¼å§:'+now)1228 sleep(1)1229 driver.find_element_by_accessibility_id('è¿å').click()1230 sleep(1)1231 #æç1232 #driver.find_element_by_accessibility_id('æç').click()1233 #sleep(2)1234 #+1235 c1=bp_is_plusexist(self)1236 if c1 == True:1237 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="addPopMenu"]').click()1238 sleep(2)1239 #建群è1240 c2=bp_is_openmultichatexist(self)1241 if c2 == True:1242 driver.find_element_by_accessibility_id('建群è').click()1243 sleep(3)1244 #cb=driver.find_elements_by_xpath('//XCUIElementTypeImage[@name="chat_unslected_icon"]')1245 cb=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')1246 sleep(2)1247 for i in range(3):1248 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[i].click()1249 sleep(1)1250 #ç¡®å® 1251 driver.find_element_by_xpath('//XCUIElementTypeButton[contains(@name,"ç¡®å®")]').click()1252 sleep(2)1253 msg=driver.find_element_by_id('chat_input_textView')1254 msg.click()1255 sleep(1)1256 now0=time.strftime('%Y-%m-%d %H_%M_%S')1257 msg.send_keys('æç¨Python群è:'+now0)1258 sleep(1)1259 #åé1260 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="Send"]').click()1261 sleep(1)1262 driver.find_element_by_accessibility_id('all page back black icon').click()1263 sleep(1)1264 #æå1265 driver.find_element_by_accessibility_id('æå').click()1266 sleep(2)1267 #æ£æ¥ç¾¤èçåéå
容æ¯å¦æ£ç¡®1268 t=driver.find_elements_by_accessibility_id('æç¨Python群è:'+now0)1269 sleep(2)1270 #print(len(t))1271 if len(t) != 0:1272 print('群èçåéå
容æ£ç¡®')1273 sleep(1)1274 else:1275 print('群èçåéå
容ä¸æ£ç¡®ï¼è¯·æ£æ¥')1276 sleep(1)1277 now=time.strftime('%Y-%m-%d %H_%M_%S')1278 sf2='../../test_report/ios/'+now+'_errorMultiChatText_R_stg_tc020.png'1279 driver.get_screenshot_as_file(sf2)1280 sleep(2)1281 now=time.strftime('%Y-%m-%d %H_%M_%S')1282 print('åç°_å起群èåè½----ç»æ:'+now)1283#*******************************************************************1284#TC Name:test_pengyou_dismissmultichat_tc0211285#Purpose:æå页é¢ç¾¤èå起人踢人åºç¾¤èãé请æåå å
¥ç¾¤èå解æ£å¹¶éåºç¾¤èçåè½æ£æ¥1286#OS:iOS1287#Device:iPhone71288#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1289#Post-conditions:N/A1290#Modify History:created by Sam [2018/08/20]1291#*******************************************************************1292 def test_pengyou_dismissmultichat_tc021(self):1293 driver=self.driver1294 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå_群èå起人踢人åºç¾¤èãé请æåå å
¥ç¾¤èå解æ£å¹¶éåºç¾¤èåè½')1295 print('step1è¿å
¥å·²åèµ·ç群èï¼æ£æ¥è¸¢äººåºç¾¤èçåè½æ¯å¦æ£å¸¸;step2æ£æ¥é请æåå å
¥ç¾¤èçåè½æ¯å¦æ£å¸¸')1296 print('step3æ£æ¥è§£æ£å¹¶éåºç¾¤èçåè½æ¯å¦æ£å¸¸')1297 now=time.strftime('%Y-%m-%d %H_%M_%S')1298 print('æå_群èå起人踢人åºç¾¤èãé请æåå å
¥ç¾¤èå解æ£å¹¶éåºç¾¤è----å¼å§:'+now)1299 sleep(1)1300 driver.find_element_by_accessibility_id('è¿å').click()1301 sleep(1)1302 #æå1303 driver.find_element_by_accessibility_id('æå').click()1304 sleep(5)1305 #群è1306 mul=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"群è")]')1307 if len(mul) != 0:1308 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"群è")]')[0].click()1309 sleep(2)1310 #...1311 driver.find_element_by_accessibility_id('im btn more').click()1312 sleep(4)1313 #-1314 #driver.find_element_by_xpath('//XCUIElementTypeImage[@value="chat_delete_icon"]').click()1315 driver.execute_script("mobile: tap", {"touchCount":"1", "x":143, "y":235})1316 sleep(2)1317 name1=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].text1318 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()1319 sleep(1)1320 driver.find_element_by_xpath('//XCUIElementTypeButton[contains(@name,"ç¡®å®")]').click()1321 sleep(3)1322 driver.find_element_by_accessibility_id('all page back black icon').click()1323 sleep(2)1324 #æ£æ¥æ¯å¦å·²è¢«ç§»åºç¾¤ç»1325 r_msg=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"被踢åºç¾¤ç»")]')1326 sleep(1)1327 #'ä½ å°'+name1+'移åºç¾¤ç»'1328 if len(r_msg) != 0:1329 print('踢人åºç¾¤èçåè½æ£æ¥éè¿')1330 sleep(1)1331 else:1332 print('踢人åºç¾¤èçåè½æ£æ¥æ²¡æéè¿ï¼è¯·æ£æ¥åå ')1333 sleep(1)1334 now=time.strftime('%Y-%m-%d %H_%M_%S')1335 sf1='../../test_report/ios/'+now+'_errorKickoff_R_stg_tc021.png'1336 driver.get_screenshot_as_file(sf1)1337 sleep(1)1338 #...1339 driver.find_element_by_accessibility_id('im btn more').click()1340 sleep(2)1341 #+1342 #driver.find_element_by_xpath('//XCUIElementTypeImage[@value="chat_add_icon"]').click()1343 driver.execute_script("mobile: tap", {"touchCount":"1", "x":322, "y":160})1344 sleep(2)1345 name2=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].text1346 sleep(1)1347 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()1348 sleep(1)1349 driver.find_element_by_xpath('//XCUIElementTypeButton[contains(@name,"ç¡®å®")]').click()1350 sleep(4)1351 driver.find_element_by_accessibility_id('all page back black icon').click()1352 sleep(3)1353 #æ£æ¥æ¯å¦å·²è¢«é请å å
¥ç¾¤ç»1354 #'ä½ é请'+name2+'å å
¥äºç¾¤ç»':if notes added, it could be wrong1355 a_msg=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"å å
¥äºç¾¤ç»")]')1356 sleep(1)1357 #print(name2)1358 if len(a_msg) != 0:1359 print('é请æåå å
¥ç¾¤èçåè½æ£æ¥éè¿')1360 sleep(1)1361 else:1362 print('é请æåå å
¥ç¾¤èçåè½æ£æ¥æ²¡æéè¿ï¼è¯·æ£æ¥åå ')1363 sleep(1)1364 now=time.strftime('%Y-%m-%d %H_%M_%S')1365 sf2='../../test_report/ios/'+now+'_errorJoin_R_stg_tc021.png'1366 driver.get_screenshot_as_file(sf2)1367 sleep(2)1368 driver.find_element_by_accessibility_id('im btn more').click()1369 sleep(2)1370 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':200,'duration':1.0})1371 sleep(2)1372 #解æ£å¹¶å é¤1373 driver.find_element_by_accessibility_id('解æ£å¹¶å é¤').click()1374 sleep(1)1375 driver.find_element_by_accessibility_id('ç¡®å®').click()1376 sleep(4)1377 #æ£æ¥è§£æ£ç群èæ¯å¦è¿åå¨1378 title1=driver.find_elements_by_accessibility_id('群è')1379 if len(title1) == 0:1380 print('解æ£å¹¶éåºç¾¤èçåè½æ£æ¥éè¿')1381 sleep(1)1382 else:1383 print('解æ£å¹¶éåºç¾¤èçåè½æ£æ¥æ²¡æéè¿ï¼è¯·æ£æ¥åå ')1384 sleep(1)1385 now=time.strftime('%Y-%m-%d %H_%M_%S')1386 sf3='../../test_report/ios/'+now+'_errorDismissMultiChat_R_stg_tc021.png'1387 driver.get_screenshot_as_file(sf3)1388 sleep(2)1389 else:1390 print('没æ群èå¯ä»¥æä½ï¼è¯·å
å起群è')1391 sleep(1)1392 now=time.strftime('%Y-%m-%d %H_%M_%S')1393 sf4='../../test_report/ios/'+now+'_errorNoMultiChat_R_stg_tc021.png'1394 driver.get_screenshot_as_file(sf4)1395 sleep(2)1396 now=time.strftime('%Y-%m-%d %H_%M_%S')1397 print('æå_群èå起人踢人åºç¾¤èãé请æåå å
¥ç¾¤èå解æ£å¹¶éåºç¾¤----ç»æ:'+now)1398#*********************************************************************************************1399#TC Name:test_jingxi_add2basket_tc0221400#Purpose:æ£æ¥æå页é¢ç¨æ·æ·»å ååå°è´ç©è½¦çåè½æµè¯1401#OS:iOS1402#Device:iPhone71403#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1404#Post-conditions:N/A1405#Modify History:created by Sam [2018/11/08]1406#*********************************************************************************************1407 def test_jingxi_add2basket_tc022(self):1408 driver=self.driver1409 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå_æå页é¢ç¨æ·æ·»å ååå°è´ç©è½¦çåè½----step1è¿å
¥æå页é¢')1410 print('step2翻页æ¾å°æéå
æ¢çååï¼step3æååå å
¥è´ç©è½¦ï¼step4ç¹å»è´ç©è½¦å¾æ è¿å
¥è´ç©è½¦é¡µé¢')1411 print('step5è´ç©è½¦é¡µé¢UIæ£æ¥')1412 now=time.strftime('%Y-%m-%d %H_%M_%S')1413 print('TC_æå_æå页é¢ç¨æ·æ·»å ååå°è´ç©è½¦çåè½----å¼å§:'+now)1414 sleep(1)1415 driver.find_element_by_accessibility_id('è¿å').click()1416 sleep(1)1417 #æå1418 driver.find_element_by_accessibility_id('æå').click()1419 sleep(8)1420 for i in range(1):1421 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':350,'duration':1.0})1422 sleep(2)1423 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':350,'duration':1.0})1424 sleep(2)1425 u1=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]')1426 if len(u1) != 0:1427 print('éè¦å
æ¢çåååå¨ï¼æ£æ¥éè¿')1428 sleep(2)1429 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]').click()1430 sleep(9)1431 page=driver.page_source1432 sleep(2)1433 #å å
¥è´ç©è½¦1434 add2b=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="å å
¥è´ç©è½¦"]')1435 sleep(2)1436 if len(add2b) != 0:1437 print('å å
¥è´ç©è½¦æé®åå¨ï¼æ£æ¥éè¿')1438 sleep(2)1439 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å å
¥è´ç©è½¦"]').click()1440 sleep(3)1441 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å å
¥è´ç©è½¦"]').click()1442 sleep(3)1443 #ç¹å»è´ç©è½¦å¾æ 1444 ###driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="1"])').click()1445 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':76, 'y':632})1446 sleep(6)1447 #æ£æ¥è´ç©è½¦é¡µé¢ui1448 chk=fun_cartui_check(self)1449 if chk == True:1450 print('è´ç©è½¦é¡µé¢UIæ£æ¥æå')1451 sleep(1)1452 else:1453 print('è´ç©è½¦é¡µé¢UIæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1454 sleep(1)1455 now=time.strftime('%Y-%m-%d %H_%M_%S')1456 sf1='../../test_report/ios/'+now+'_errorCartUI_R_stg_tc022.png'1457 driver.get_screenshot_as_file(sf1)1458 sleep(2)1459 #37,411460 ###driver.find_element_by_xpath('//XCUIElementTypeOther[1]/XCUIElementTypeOther').click()1461 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':37, 'y':41})1462 sleep(2)1463 else:1464 print('å å
¥è´ç©è½¦æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')1465 sleep(2)1466 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':40})1467 sleep(2)1468 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':40})1469 sleep(2)1470 else:1471 print('éè¦å
æ¢çååä¸åå¨ï¼è¯·éæ°æé')1472 sleep(2)1473 now=time.strftime('%Y-%m-%d %H_%M_%S')1474 print('TC_æå_æå页é¢ç¨æ·æ·»å ååå°è´ç©è½¦çåè½----ç»æ:'+now)1475#*********************************************************************************************1476#TC Name:test_jingxi_basket2exchange_tc0231477#Purpose:æ£æ¥æå页é¢ä»è´ç©è½¦ä¸åå
æ¢ååçåè½1478#Pre-c#OS:iOS1479#Device:iPhone71480#Post-conditions:N/A1481#Modify History:created by Sam [2018/11/08]1482#*********************************************************************************************1483 def test_jingxi_basket2exchange_tc023(self):1484 driver=self.driver1485 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå_ç¨æ·ä»è´ç©è½¦ä¸åå
æ¢ååçåè½----step1è¿å
¥æå页é¢')1486 print('step2ç¹å»è´ç©è½¦å¾æ è¿å
¥è´ç©è½¦é¡µé¢ï¼step3ç¹å»ç¼è¾æé®è¿å
¥ç¼è¾é¡µé¢ï¼step4æ¹åæéååçè§æ ¼ï¼é¢è²')1487 print('step5æ¹åæéååçæ°é;step6æ¹åæ¶è´§å°å;step7ç«å³ä¸åæ£æ¥è®¢åæ¯å¦å·²æ交')1488 print('step8æ¥ç订åæ£æ¥ååç¶ææ¯å¦ä¸ºæªåè´§')1489 now=time.strftime('%Y-%m-%d %H_%M_%S')1490 print('TC_æå_æå页é¢ç¨æ·æ·»å ååå°è´ç©è½¦çåè½----å¼å§:'+now)1491 sleep(2)1492 driver.find_element_by_accessibility_id('è¿å').click()1493 sleep(2)1494 #æ¤å»1495 driver.find_element_by_accessibility_id('æå').click()1496 sleep(8)1497 #ç¹å»è´ç©è½¦å¾æ 1498 #driver.find_element_by_xpath('//XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther').click()1499 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':335, 'y':41})1500 sleep(6)1501 #refresh1502 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':100,'toX':50,'toY':500,'duration':1.0})1503 #sleep(2)1504 chk0=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"å»æ·»å ç¹ä»ä¹å§")]')1505 sleep(2)1506 if len(chk0) != 0:1507 print('è´ç©è½¦é没æååï¼è¯·å
å»æå页é¢æ·»å ')1508 sleep(1)1509 else:1510 #print('Yes')1511 sleep(1)1512 #æ£æ¥è´ç©è½¦é¡µé¢ui1513 chk=fun_cartui_check(self)1514 if chk == True:1515 print('è´ç©è½¦é¡µé¢UIæ£æ¥æå')1516 sleep(2)1517 #285,431518 driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç¼è¾"]')[4].click()1519 sleep(6)1520 try:1521 #æ¹åååæ°é1522 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':334, 'y':275})1523 sleep(3)1524 #å®æ1525 driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="å®æ"]')[4].click()1526 sleep(2)1527 driver.find_element_by_accessibility_id('ç«å³è´ä¹°').click()1528 sleep(3)1529 #æ¹åæ¶è´§å°å1530 ###driver.find_element_by_xpath('//XCUIElementTypeOther[contains(@name,"èµµåé¾")]').click()1531 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':289, 'y':139})1532 sleep(2)1533 #第äºä¸ªå°å1534 driver.find_element_by_xpath('//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther[2]').click()1535 sleep(2)1536 driver.find_element_by_accessibility_id('ç«å³ä¸å').click()1537 sleep(1)1538 driver.find_element_by_accessibility_id('ç¡®å®').click()1539 sleep(3)1540 chk=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="订åå·²æ交"]')1541 sleep(1)1542 if len(chk) == 0:1543 print('订åå·²æ交æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1544 sleep(1)1545 now=time.strftime('%Y-%m-%d %H_%M_%S')1546 sf1='../../test_report/ios/'+now+'_errorGiftOrder_R_stg_tc023.png'1547 driver.get_screenshot_as_file(sf1)1548 sleep(2)1549 else:1550 print('订åå·²æ交æ£æ¥éè¿')1551 sleep(2)1552 #æ¥ç订å1553 driver.find_element_by_accessibility_id('æ¥ç订å').click()1554 sleep(6)1555 #æ£æ¥ååç¶æ1556 chk1=driver.find_elements_by_xpath('//XCUIElementTypeOther[contains(@name,"çç®iPhoneææºå£³")]')1557 chk2=driver.find_elements_by_xpath('//XCUIElementTypeOther[contains(@name,"å·²ä»æ¬¾")]')1558 sleep(1)1559 if len(chk1) != 0 and len(chk2) != 0:1560 print('订åéååç¶ææ£æ¥éè¿')1561 sleep(1)1562 else:1563 print('订åéååç¶ææ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1564 sleep(1)1565 now=time.strftime('%Y-%m-%d %H_%M_%S')1566 sf1='../../test_report/ios/'+now+'_errorGiftStatus_R_stg_tc023.png'1567 driver.get_screenshot_as_file(sf1)1568 sleep(2)1569 except Exception as e:1570 print('åçå¼å¸¸ï¼'+str(e))1571 sleep(2)1572 pass1573 else:1574 print('è´ç©è½¦é¡µé¢UIæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1575 sleep(1)1576 now=time.strftime('%Y-%m-%d %H_%M_%S')1577 sf1='../../test_report/ios/'+now+'_errorCartUI_R_stg_tc023.png'1578 driver.get_screenshot_as_file(sf1)1579 sleep(2)1580 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':41})1581 sleep(2)1582 now=time.strftime('%Y-%m-%d %H_%M_%S')1583 print('TC_æå_ç¨æ·ä»è´ç©è½¦ä¸åå
æ¢ååçåè½----ç»æ:'+now)1584#*******************************************************1585#TC Name:test_wode_checkin_tc0251586#Purpose:æç页é¢ç¹å»ç¾å°åæ£æ¥å½æ¥ç¾å°ç§¯åæ¯å¦è½æ£å¸¸è·å¾çåè½1587#OS:iOS1588#Device:iPhone71589#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1590#Post-conditions:N/A1591#Modify History:created by Sam [2018/08/20]1592#*******************************************************1593 def test_wode_checkin_tc025(self):1594 driver=self.driver1595 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°é¦é¡µ_å起群èåè½---step1æ£æ¥æç页é¢å³ä¸è§ç¹å»ç¾å°æ¯å¦åå¨ï¼')1596 print('step2æ£æ¥ç¹å»ç¾å°åè½æ¯å¦æ£å¸¸ï¼step3å°ç§¯åæç»é¡µé¢æ£æ¥å½æ¥ç¾å°ç积åæ¯å¦å·²ç»è·å¾')1597 now=time.strftime('%Y-%m-%d %H_%M_%S')1598 print('æç_ç¹å»ç¾å°åæ£æ¥å½æ¥ç¾å°ç§¯åæ¯å¦è½æ£å¸¸è·å¾çåè½----å¼å§:'+now)1599 sleep(1)1600 driver.find_element_by_accessibility_id('è¿å').click()1601 sleep(1)1602 #æç1603 driver.find_element_by_accessibility_id('æç').click()1604 sleep(2)1605 #ç¹å»ç¾å°accessibility_id('ç¹å»ç¾å°')1606 chk=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="ç¹å»ç¾å°"]')1607 if len(chk) != 0:1608 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç¹å»ç¾å°"]').click()1609 sleep(2)1610 else:1611 print('ä»æ¥å·²ç»ç¾å°è¿ï¼è¯·ææ¥åæ¥')1612 sleep(1)1613 #æ£æ¥ç§¯å1614 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeOther/XCUIElementTypeButton[2]').click()1615 sleep(2)1616 cb=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="æ¯æ¥ç¾å°"]')1617 #print(len(cb))1618 nowtm=time.strftime('%Y.%m.%d')1619 tm=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name, nowtm)]')1620 sleep(1)1621 if len(cb) != 0 and len(tm) != 0:1622 print('æ¯æ¥ç¾å°è·å积ååè½æ£æ¥éè¿')1623 sleep(1)1624 else:1625 print('æ¯æ¥ç¾å°è·å积ååè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1626 sleep(1)1627 now=time.strftime('%Y-%m-%d %H_%M_%S')1628 sf2='../../test_report/ios/'+now+'_errorCheckinScore_R_stg_tc025.png'1629 driver.get_screenshot_as_file(sf2)1630 sleep(1)1631 driver.find_element_by_accessibility_id('all page back black icon').click()1632 sleep(2)1633 now=time.strftime('%Y-%m-%d %H_%M_%S')1634 print('æç_ç¹å»ç¾å°åæ£æ¥å½æ¥ç¾å°ç§¯åæ¯å¦è½æ£å¸¸è·å¾çåè½----ç»æ:'+now)1635#*******************************************************1636#TC Name:test_pengyou_nicknameheadicon_tc0281637#Purpose:æå页é¢ä¿®æ¹ç¾¤èæµç§°å头ååè½1638#OS:iOS1639#Device:iPhone71640#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1641#Post-conditions:N/A1642#Modify History:created by Sam [2018/08/22]1643#*******************************************************1644 def test_pengyou_nicknameheadicon_tc028(self):1645 driver=self.driver1646 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·æå页é¢_ä¿®æ¹ç¾¤èæµç§°å头ååè½---step1æ£æ¥æå页é¢ç¾¤èæ¯å¦åå¨ï¼')1647 print('step2è¿å
¥ç¾¤èä¿®æ¹ç¾¤ç»å称ï¼step3æ£æ¥ç¾¤ç»å称æ¯å¦ä¿®æ¹æå')1648 #ï¼step4æ£æ¥ä¿®æ¹ç¾¤ç»å¤´ååè½æ¯å¦æ£å¸¸1649 now=time.strftime('%Y-%m-%d %H_%M_%S')1650 print('TC_æå_ä¿®æ¹ç¾¤èå称å头ååè½----å¼å§:'+now)1651 sleep(1)1652 driver.find_element_by_accessibility_id('è¿å').click()1653 sleep(1)1654 #æå1655 try:1656 driver.find_element_by_accessibility_id('æå').click()1657 sleep(6)1658 t=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"群è")]')1659 sleep(1)1660 if len(t) != 0:1661 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"群è")]')[0].click()1662 sleep(2)1663 driver.find_element_by_xpath('//XCUIElementTypeNavigationBar[contains(@name,"群è")]/XCUIElementTypeButton[2]').click()1664 sleep(2)1665 #ä¿®æ¹ç¾¤ç»å称1666 driver.find_element_by_xpath('//XCUIElementTypeStaticText[contains(@name,"群è")]').click()1667 sleep(1)1668 edit=driver.find_element_by_class_name('XCUIElementTypeTextField')1669 edit.click()1670 sleep(1)1671 edit.clear()1672 sleep(1)1673 edit.send_keys('群ènew')1674 sleep(1)1675 driver.find_element_by_accessibility_id('ä¿å').click()1676 sleep(2)1677 nk=driver.find_elements_by_accessibility_id('群ènew')1678 if len(nk) != 0:1679 print('群ç»çå称已ç»ä¿®æ¹æå')1680 else:1681 print('群ç»çå称没æä¿®æ¹æåï¼è¯·æ£æ¥åå ')1682 now=time.strftime('%Y-%m-%d %H_%M_%S')1683 sf1='../../test_report/ios/'+now+'_errorName_R.png'1684 driver.get_screenshot_as_file(sf1)1685 sleep(1)1686 """1687 #ä¿®æ¹å¤´å1688 driver.find_element_by_accessibility_id('群ç»å¤´å').click()1689 sleep(1)1690 #æç
§1691 driver.find_element_by_accessibility_id('æç
§').click()1692 sleep(3)1693 ok=driver.find_elements_by_accessibility_id('好')1694 if len(ok) != 0:1695 driver.find_element_by_accessibility_id('好').click()1696 sleep(2)1697 driver.find_element_by_accessibility_id('FrontBackFacingCameraChooser').click()1698 sleep(2)1699 driver.find_element_by_accessibility_id('PhotoCapture').click()1700 sleep(2)1701 driver.find_element_by_accessibility_id('使ç¨ç
§ç').click()1702 sleep(10)1703 #ä¿®æ¹å¤´å1704 driver.find_element_by_accessibility_id('群ç»å¤´å').click()1705 sleep(1)1706 #ä»ææºç¸åéæ©1707 driver.find_element_by_accessibility_id('ä»ææºç¸åéæ©').click()1708 sleep(2)1709 #å±å¹å¿«ç
§1710 driver.find_element_by_accessibility_id('å±å¹å¿«ç
§').click()1711 sleep(2)1712 for i in range(2):1713 self.driver.execute_script("mobile: scroll", {"direction": "up"})1714 sleep(2)1715 driver.find_elements_by_class_name('XCUIElementTypeCell')[0].click()1716 sleep(2)1717 #éå1718 driver.find_element_by_accessibility_id('éå').click()1719 sleep(10)1720 """1721 driver.find_element_by_accessibility_id('all page back black icon').click()1722 sleep(1)1723 driver.find_element_by_accessibility_id('all page back black icon').click()1724 sleep(1)1725 else:1726 print('没æ群èå¯ä»¥æä½ï¼è¯·å
å起群è')1727 sleep(1)1728 now=time.strftime('%Y-%m-%d %H_%M_%S')1729 sf3='../../test_report/ios/'+now+'_errorNoMultichat_R_stg_tc028.png'1730 driver.get_screenshot_as_file(sf3)1731 sleep(2)1732 except Exception as e:1733 print('åçå¼å¸¸ï¼'+str(e))1734 sleep(1)1735 pass1736 now=time.strftime('%Y-%m-%d %H_%M_%S')1737 print('TC_æå_ä¿®æ¹ç¾¤èå称å头ååè½----ç»æ:'+now)1738#*******************************************************1739#TC Name:test_pengyou_searchwatch_tc0291740#Purpose:æå页é¢æ索好å并æå¼ä¸ªäººä¸»é¡µè¿è¡å
³æ³¨1741#OS:iOS1742#Device:iPhone71743#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1744#Post-conditions:N/A1745#Modify History:created by Sam [2018/08/21]1746#*******************************************************1747 def test_pengyou_searchwatch_tc029(self):1748 driver=self.driver1749 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·æå页é¢_æå页é¢æ索好å并æå¼ä¸ªäººä¸»é¡µè¿è¡å
³æ³¨---')1750 print('step1æå页é¢ç¹+å·ï¼æ£æ¥æ·»å æåæé®æ¯å¦åå¨ï¼step2è¾å
¥å¥½åå称è¿è¡æç´¢ï¼')1751 print('step3ç¹å»æç´¢åºçæåæå¼ä»ç个人主页ï¼step4æ£æ¥å
³æ³¨åè½æ¯å¦æ£å¸¸')1752 now=time.strftime('%Y-%m-%d %H_%M_%S')1753 print('TC_æå_æ索好å并æå¼ä¸ªäººä¸»é¡µè¿è¡å
³æ³¨----å¼å§:'+now)1754 sleep(2)1755 driver.find_element_by_accessibility_id('è¿å').click()1756 sleep(2)1757 #æå1758 driver.find_element_by_accessibility_id('æå').click()1759 sleep(5)1760 driver.find_element_by_xpath('//XCUIElementTypeNavigationBar[@name="æå"]/XCUIElementTypeButton').click()1761 sleep(2)1762 #ç¹+å·1763 driver.find_element_by_xpath('//XCUIElementTypeNavigationBar[@name="æåå表"]/XCUIElementTypeButton[2]').click()1764 sleep(1)1765 add=driver.find_elements_by_accessibility_id('æ·»å æå')1766 if len(add) != 0:1767 driver.find_element_by_accessibility_id('æ·»å æå').click()1768 sleep(2)1769 edit=driver.find_element_by_xpath('//XCUIElementTypeSearchField[@name="æµç§°/ææºå·"]')1770 edit.click()1771 sleep(0.5)1772 driver.find_element_by_xpath('//XCUIElementTypeSearchField[@name="æµç§°/ææºå·"]').set_value('å¼ ä¸')1773 sleep(1)1774 #search1775 driver.find_element_by_accessibility_id('Search').click() 1776 sleep(3)1777 ff=driver.find_elements_by_class_name('XCUIElementTypeCell')1778 sleep(2)1779 #print(len(ff))1780 if len(ff) != 0:1781 print('æ索好ååè½æ£æ¥éè¿')1782 sleep(1)1783 driver.find_elements_by_class_name('XCUIElementTypeCell')[1].click()1784 sleep(4)1785 #å
³æ³¨1786 t=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="å
³æ³¨"]')1787 if len(t) == 2:1788 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="å
³æ³¨"]')[1].click()1789 sleep(3)1790 tt=driver.find_elements_by_accessibility_id('å·²å
³æ³¨')1791 if len(tt) != 0:1792 print('好åå·²ç»å
³æ³¨æå')1793 sleep(1)1794 else:1795 print('好å没æå
³æ³¨æåï¼è¯·æ£æ¥åå ')1796 now=time.strftime('%Y-%m-%d %H_%M_%S')1797 sf1='../../test_report/ios/'+now+'_errorWatch_R_stg_tc029.png'1798 driver.get_screenshot_as_file(sf1)1799 sleep(1)1800 else:1801 print('该好åä½ ä»¥åå·²ç»å
³æ³¨è¿äºï¼æ éåæä½')1802 sleep(1)1803 driver.find_element_by_accessibility_id('full screen back icon').click()1804 sleep(2)1805 #driver.find_element_by_accessibility_id('all page back black icon').click()1806 #sleep(2)1807 else:1808 print('æ索好ååè½æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')1809 sleep(1)1810 #åæ¶1811 driver.find_element_by_accessibility_id('åæ¶').click() 1812 sleep(2)1813 driver.find_element_by_accessibility_id('all page back black icon').click()1814 sleep(2)1815 else:1816 print('没ææ·»å æåæé®ï¼è¯·æ£æ¥åå ')1817 sleep(1)1818 now=time.strftime('%Y-%m-%d %H_%M_%S')1819 sf3='../../test_report/ios/'+now+'_errorNoAddFriend_R_stg_tc029.png'1820 driver.get_screenshot_as_file(sf3)1821 sleep(2)1822 driver.find_element_by_accessibility_id('all page back black icon').click() 1823 sleep(2)1824 now=time.strftime('%Y-%m-%d %H_%M_%S')1825 print('TC_æå_æ索好å并æå¼ä¸ªäººä¸»é¡µè¿è¡å
³æ³¨----ç»æ:'+now)1826#*******************************************************1827#TC Name:test_wode_resetsecupwd_tc0301828#Purpose:æç页é¢è®¾ç½®ééç½®æå¡å®å
¨å¯ç çåè½1829#OS:iOS1830#Device:iPhone71831#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1832#Post-conditions:N/A1833#Modify History:created by Sam [2018/08/22]1834#*******************************************************1835 def test_wode_resetsecupwd_tc030(self):1836 driver=self.driver1837 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°é¦é¡µ_å起群èåè½---step1æç页é¢éç¹è®¾ç½®ï¼')1838 print('step2ç¹å»æå¡å®å
¨å¯ç ï¼step3æ£æ¥éç½®æå¡å®å
¨å¯ç çåè½æ¯å¦æ£å¸¸')1839 now=time.strftime('%Y-%m-%d %H_%M_%S')1840 print('æç_设置ééç½®æå¡å®å
¨å¯ç çåè½----å¼å§:'+now)1841 sleep(4)1842 #æç1843 driver.find_element_by_accessibility_id('æç').click()1844 sleep(2)1845 #self.driver.execute_script("mobile: scroll", {"direction": "down"})1846 driver.execute_script("mobile: dragFromToForDuration",{"fromX":50,"fromY":500,"toX":50,"toY":200,"duration":1.0})1847 sleep(2)1848 driver.find_element_by_accessibility_id('设置').click()1849 sleep(2)1850 #æå¡å®å
¨å¯ç 1851 driver.find_element_by_accessibility_id('æå¡å®å
¨å¯ç ').click()1852 sleep(3)1853 code=driver.find_element_by_class_name('XCUIElementTypeTextField')1854 code.click()1855 code.send_keys('112233')1856 sleep(1)1857 driver.find_element_by_accessibility_id('ä¸ä¸æ¥').click()1858 sleep(2)1859 #身份类å1860 driver.find_elements_by_class_name('XCUIElementTypeTextField')[0].click()1861 sleep(1)1862 driver.find_element_by_accessibility_id('ç¡®å®').click()1863 sleep(2)1864 idnum=driver.find_elements_by_class_name('XCUIElementTypeTextField')[1]1865 idnum.click()1866 idnum.send_keys('340103197301142518')1867 sleep(1)1868 #å®æ1869 driver.find_element_by_accessibility_id('Toolbar Done Button').click()1870 sleep(1)1871 #ä¸ä¸æ¥1872 driver.find_element_by_accessibility_id('ä¸ä¸æ¥').click()1873 sleep(2)1874 p=[]1875 for i in range(6):1876 r=random.randint(0,9)1877 p.append(str(r))1878 print('éç½®çå¯ç æ¯ï¼'+str(p))1879 sleep(1)1880 for j in range(6):1881 driver.find_element_by_accessibility_id(p[j]).click()1882 sleep(1)1883 for j in range(6):1884 driver.find_element_by_accessibility_id(p[j]).click()1885 sleep(1)1886 sleep(2)1887 chk=driver.find_elements_by_accessibility_id('éç½®æå')1888 if len(chk) != 0:1889 print('æå¡å®å
¨å¯ç éç½®æå')1890 sleep(1)1891 else:1892 print('æå¡å®å
¨å¯ç é置失败ï¼è¯·æ£æ¥åå ')1893 sleep(1)1894 now=time.strftime('%Y-%m-%d %H_%M_%S')1895 sf2='../../test_report/ios/'+now+'_errorResetSecupwd_R_tc030.png'1896 driver.get_screenshot_as_file(sf2)1897 sleep(1)1898 driver.find_element_by_accessibility_id('all page back black icon').click()1899 sleep(2)1900 now=time.strftime('%Y-%m-%d %H_%M_%S')1901 print('æç_设置ééç½®æå¡å®å
¨å¯ç çåè½----ç»æ:'+now)1902#*******************************************************1903#TC Name:test_wode_addeditaddress_tc0311904#Purpose:æç页é¢éå°å管ç页é¢æ°å¢åç¼è¾ä¸ä¸ªæ¶è´§å°åçåè½1905#OS:iOS1906#Device:iPhone71907#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app1908#Post-conditions:N/A1909#Modify History:created by Sam [2018/08/22]1910#*******************************************************1911 def test_wode_addeditaddress_tc031(self):1912 driver=self.driver1913 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°é¦é¡µ_å起群èåè½---step1æç页é¢éç¹å»å¤´å')1914 print('step2ç¹å»ç¼è¾ä¸ªäººä¿¡æ¯ï¼step3ç¹å»æçå°åè¿å
¥å°å管ç页é¢;step4æ£æ¥æ·»å æ°å°åçåè½æ¯å¦æ£å¸¸')1915 print('step5æ£æ¥ç¼è¾å°åçåè½æ¯å¦æ£å¸¸')1916 now=time.strftime('%Y-%m-%d %H_%M_%S')1917 print('TC_æç_æ°å¢åç¼è¾ä¸ä¸ªæ¶è´§å°åçåè½----å¼å§:'+now)1918 sleep(2)1919 driver.find_element_by_accessibility_id('è¿å').click()1920 sleep(2)1921 #æç1922 driver.find_element_by_accessibility_id('æç').click()1923 sleep(3)1924 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="SamSTG"]').click()1925 sleep(2)1926 #ç¼è¾ä¸ªäººä¿¡æ¯1927 driver.find_element_by_accessibility_id('ç¼è¾ä¸ªäººä¿¡æ¯').click()1928 sleep(2)1929 #æçå°å1930 driver.find_element_by_accessibility_id('æçå°å').click()1931 sleep(2)1932 #æ·»å æ°å°å1933 add=driver.find_elements_by_accessibility_id('æ·»å æ°å°å')1934 if len(add) != 0:1935 print('æ·»å æ°å°åæé®åå¨,æ£æ¥éè¿')1936 sleep(1)1937 driver.find_element_by_accessibility_id('æ·»å æ°å°å').click()1938 sleep(1)1939 name=driver.find_elements_by_class_name('XCUIElementTypeTextField')[0]1940 name.click()1941 r=random.randint(10,99)1942 sleep(1)1943 name.send_keys('æµè¯'+str(r))1944 sleep(1)1945 pnum=driver.find_elements_by_class_name('XCUIElementTypeTextField')[1]1946 pnum.click()1947 r2=random.randint(10,99)1948 sleep(1)1949 pnum.send_keys('138160328'+str(r2))1950 sleep(1)1951 #å®æ1952 driver.find_element_by_accessibility_id('Toolbar Done Button').click()1953 sleep(1)1954 #éæ©æå¨å°åº1955 driver.find_element_by_accessibility_id('éæ©æå¨å°åº').click()1956 sleep(2)1957 #ç¡®å®1958 driver.find_element_by_accessibility_id('ç¡®å®').click()1959 sleep(1)1960 #è¡é/楼çå·ç1961 addr=driver.find_element_by_class_name('XCUIElementTypeTextView')1962 addr.click()1963 r3=random.randint(100,999)1964 sleep(1)1965 addr.send_keys('ä¸å±±åè·¯'+str(r3)+'å·')1966 sleep(1)1967 #å®æ1968 driver.find_element_by_accessibility_id('Toolbar Done Button').click()1969 sleep(1)1970 #ä¿å1971 driver.find_element_by_accessibility_id('ä¿å').click()1972 sleep(1)1973 #æ£æ¥toast1974 save1=driver.find_elements_by_accessibility_id('ä¿åæå')1975 if len(save1) != 0:1976 print('æ°å¢å°åæå')1977 else:1978 print('æ°å¢å°å失败ï¼è¯·æ£æ¥åå ')1979 now=time.strftime('%Y-%m-%d %H_%M_%S')1980 sf2='../../test_report/ios/'+now+'_errorAddnewaddr_R_stg_tc031.png'1981 driver.get_screenshot_as_file(sf2)1982 else:1983 print('æ·»å æ°å°åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')1984 sleep(1)1985 #ç¼è¾1986 edi=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="ç¼è¾"]')1987 if len(edi) != 0:1988 print('ç¼è¾æé®åå¨,æ£æ¥éè¿')1989 sleep(1)1990 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="ç¼è¾"]').click()1991 sleep(1)1992 name=driver.find_elements_by_class_name('XCUIElementTypeTextField')[0]1993 name.click()1994 #old=name.get_attribute('value')1995 r4=random.randint(10,99)1996 sleep(1)1997 name.send_keys(str(r4))1998 sleep(1)1999 #ä¿å2000 driver.find_element_by_accessibility_id('ä¿å').click()2001 sleep(1)2002 #æ£æ¥toast2003 save2=driver.find_elements_by_accessibility_id('ä¿®æ¹æå')2004 if len(save2) != 0:2005 print('ç¼è¾å°åæå')2006 else:2007 print('ç¼è¾å°å失败ï¼è¯·æ£æ¥åå ')2008 now=time.strftime('%Y-%m-%d %H_%M_%S')2009 sf1='../../test_report/ios/'+now+'_errorEditaddr_R_stg_tc031.png'2010 driver.get_screenshot_as_file(sf1)2011 else:2012 print('ç¼è¾æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2013 sleep(1)2014 driver.find_element_by_accessibility_id('all page back black icon').click()2015 sleep(2)2016 driver.find_element_by_accessibility_id('all page back black icon').click()2017 sleep(2)2018 driver.find_element_by_accessibility_id('full screen back icon').click()2019 sleep(2)2020 now=time.strftime('%Y-%m-%d %H_%M_%S')2021 print('TC_æç_æ°å¢åç¼è¾ä¸ä¸ªæ¶è´§å°åçåè½----ç»æ:'+now)2022#*******************************************************2023#TC Name:test_faxian_expershowpic_tc0322024#Purpose:åç°é¡µé¢ä½éªtabæ´»å¨çæå¾åè½2025#OS:iOS2026#Device:iPhone72027#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2028#Post-conditions:N/A2029#Modify History:created by Sam [2018/08/23]2030#*******************************************************2031 def test_faxian_expershowpic_tc032(self):2032 driver=self.driver2033 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°ââä½éªtabæ´»å¨çæå¾åè½---step1åç°é¡µé¢éç¹å»ä½éªtab')2034 print('step2åæ¢å°ç¹æ¾å°ä¸ä¸ªååæ´»å¨ï¼step3æ£æ¥æå¾åè½æ¯å¦æ£å¸¸;step4æ£æ¥æå¾çæåæ¯å¦æ£ç¡®')2035 print('step5æ£æ¥æå¾ç9å¼ å¾çæ°éæ¯å¦æ£ç¡®')2036 now=time.strftime('%Y-%m-%d %H_%M_%S')2037 print('TC_åç°ââä½éªtabæ´»å¨çæå¾åè½----å¼å§:'+now)2038 sleep(1)2039 driver.find_element_by_accessibility_id('è¿å').click()2040 sleep(1)2041 #ä½éª2042 driver.find_element_by_accessibility_id('ä½éª').click()2043 sleep(2)2044 driver.find_element_by_xpath('//XCUIElementTypeCell/XCUIElementTypeButton[2]').click()2045 sleep(2)2046 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':150,'duration':1.0})2047 #sleep(2)2048 driver.find_element_by_accessibility_id('èæ¥ä¸å¿ä¸¨ä¸æµ·å¤ªå¤æ±åº1112121312').click()2049 sleep(2)2050 driver.find_element_by_accessibility_id('æ°æ´»å¨_9.7stg1').click()2051 sleep(4)2052 #æå¾2053 #river.execute_script("mobile: tap", {"touchCount":"1", "x":330, "y":620})2054 show=driver.find_elements_by_xpath('//XCUIElementTypeLink[@name="æå¾"]')2055 sleep(2)2056 if len(show) != 0:2057 print('æå¾æé®åå¨,æ£æ¥éè¿')2058 sleep(1)2059 driver.find_element_by_xpath('//*[@name="æå¾"]').click()2060 sleep(2)2061 #+2062 driver.execute_script("mobile: tap", {"touchCount":"1", "x":65, "y":264})2063 sleep(2)2064 #好2065 allow=driver.find_elements_by_accessibility_id('好')2066 if len(allow) != 0:2067 driver.find_element_by_accessibility_id('好').click()2068 sleep(2)2069 for i in range(1,10):2070 driver.find_elements_by_ios_predicate('name=="compose guide check box defaul"')[i].click()2071 sleep(1)2072 driver.find_element_by_accessibility_id('å®æ(9/9)').click()2073 sleep(1)2074 word=driver.find_element_by_xpath('//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')2075 word.click()2076 sleep(1)2077 now0=time.strftime('%Y-%m-%d %H_%M_%S')2078 word.send_keys('人çè¦çä½éªæå¾:'+now0)2079 sleep(1)2080 driver.find_element_by_accessibility_id('åå¸').click()2081 sleep(13)2082 #check numbers of pictures and published text here2083 title=driver.find_elements_by_xpath('//XCUIElementTypeTextView[contains(@value,"人çè¦çä½éªæå¾:")]')2084 sleep(2)2085 if len(title) != 0:2086 print('ä½éªæå¾çæåæ£æ¥éè¿')2087 sleep(1)2088 else:2089 print('ä½éªæå¾çæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2090 sleep(1)2091 now=time.strftime('%Y-%m-%d %H_%M_%S')2092 sf1='../../test_report/ios/'+now+'_errorShowpicText_R_stg_tc032.png'2093 driver.get_screenshot_as_file(sf1)2094 sleep(2)2095 number=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="9"]')2096 #print(number.text)2097 if len(number) != 0:2098 print('ä½éªæå¾çä¸ä¼ 9å¼ å¾çæ£æ¥éè¿')2099 sleep(1)2100 else:2101 print('ä½éªæå¾çä¸ä¼ 9å¼ å¾çæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2102 sleep(1)2103 now=time.strftime('%Y-%m-%d %H_%M_%S')2104 sf2='../../test_report/ios/'+now+'_errorPic9_R_stg_tc032.png'2105 driver.get_screenshot_as_file(sf2)2106 sleep(2)2107 driver.find_element_by_accessibility_id('all page back black icon').click()2108 sleep(4)2109 else:2110 print('æå¾æé®ä¸åå¨/æ¾ä¸å°ï¼è¯·æ£æ¥åå ')2111 sleep(2)2112 driver.execute_script("mobile: tap", {"touchCount":"1", "x":32, "y":42})2113 #driver.find_element_by_xpath('//XCUIElementTypeOther[@name="èæ¥"]/XCUIElementTypeOther[1]').click()2114 sleep(2)2115 now=time.strftime('%Y-%m-%d %H_%M_%S')2116 print('TC_åç°ââä½éªtabæ´»å¨çæå¾åè½----ç»æ:'+now)2117#*******************************************************2118#TC Name:test_faxian_publishnowatfriend_tc0332119#Purpose:æ£æ¥åç°é¡µé¢çåå¸æ¤å»å¹¶@好åçåè½2120#OS:iOS2121#Device:iPhone72122#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2123#Post-conditions:N/A2124#Modify History:created by Sam [2018/08/24]2125#*******************************************************2126 def test_faxian_publishnowatfriend_tc033(self):2127 driver=self.driver2128 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åå¸æ¤å»å¹¶@好åçåè½----step1æ£æ¥åç°é¦é¡µå³ä¸è§+å·æ¯å¦åå¨ï¼')2129 print('step2æ£æ¥åå¸æ¤å»æé®æ¯å¦åå¨ï¼step3åå¸å¹¶@好ååè½æ¯å¦æ£å¸¸ï¼step4æ£æ¥åå¸å
容éæ¯å¦å¯ä»¥ä¸æ¬¡æ大ä¸ä¼ 9å¼ å¾çï¼')2130 print('step5æ£æ¥åå¸æåæ¯å¦æ£ç¡®;step6éåºå½åè´¦å·å¹¶å·²@ç好åè´¦å·ç»å½app;step7æ£æ¥æå页é¢éæ¯å¦æ¶å°@éç¥')2131 now=time.strftime('%Y-%m-%d %H_%M_%S')2132 print('TC_åç°_åå¸æ¤å»å¹¶@好å----å¼å§:'+now)2133 sleep(1)2134 driver.find_element_by_accessibility_id('è¿å').click()2135 sleep(1)2136 #åç°2137 #driver.find_element_by_accessibility_id('//*[@text="åç°"]').click()2138 #sleep(2)2139 c1=bp_is_plusexist(self)2140 if c1 == True:2141 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="addPopMenu"]').click()2142 sleep(2)2143 #åæ¤å»2144 c2=bp_is_publishnowexist(self)2145 if c2 == True:2146 print('åæ¤å»æé®åå¨ï¼æ£æ¥éè¿')2147 sleep(1)2148 driver.find_element_by_accessibility_id('åæ¤å»').click()2149 sleep(2)2150 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':55, 'y':264})2151 sleep(2)2152 #好2153 allow=driver.find_elements_by_accessibility_id('好')2154 if len(allow) != 0:2155 driver.find_element_by_accessibility_id('好').click()2156 sleep(2)2157 sleep(1)2158 for i in range(1,10):2159 driver.find_elements_by_ios_predicate('name=="compose guide check box defaul"')[i].click()2160 sleep(1)2161 driver.find_element_by_accessibility_id('å®æ(9/9)').click()2162 sleep(1)2163 word=driver.find_element_by_xpath('//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')2164 sleep(2)2165 word.click()2166 now0=time.strftime('%Y-%m-%d %H_%M_%S')2167 word.send_keys('I love China:'+now0)2168 sleep(1)2169 #@2170 driver.find_element_by_accessibility_id('atSome btn').click()2171 sleep(1)2172 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':200,'duration':1.0})2173 #sleep(2)2174 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()2175 sleep(1)2176 driver.find_element_by_accessibility_id('åå¸').click()2177 sleep(2)2178 #check numbers of pictures and published text here2179 title=driver.find_elements_by_xpath('//XCUIElementTypeTextView[contains(@value,"I love China:")]')2180 if len(title) != 0:2181 print('åå¸å
容çæåæ£æ¥éè¿')2182 else:2183 print('åå¸å
容çæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2184 now=time.strftime('%Y-%m-%d %H_%M_%S')2185 sf1='../../test_report/ios/'+now+'_errorText_R_stg_tc033.png'2186 driver.get_screenshot_as_file(sf1)2187 sleep(2)2188 number=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="9"]')2189 if len(number) != 0:2190 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥éè¿')2191 else:2192 print('åå¸å
容çä¸ä¼ 9å¼ å¾çæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2193 now=time.strftime('%Y-%m-%d %H_%M_%S')2194 sf2='../../test_report/ios/'+now+'_errorPic9_R_stg_tc033.png'2195 driver.get_screenshot_as_file(sf2)2196 sleep(2)2197 """2198 #logout2199 #æç2200 driver.find_element_by_accessibility_id('æç').click()2201 sleep(3)2202 driver.execute_script('mobile: dragFromToForDuration',{'fromX':250,'fromY':550,'toX':250,'toY':200,'duration':1.0})2203 sleep(2)2204 #设置2205 driver.find_element_by_accessibility_id('设置').click()2206 sleep(1)2207 driver.find_element_by_accessibility_id('éåºç»å½').click()2208 sleep(1)2209 driver.find_element_by_accessibility_id('确认').click()2210 sleep(2)2211 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':200,'toX':50,'toY':550,'duration':1.0})2212 sleep(3)2213 #relogin as 'Sam8198'2214 #not working now2215 #driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="注å/ç»å½"]').click()2216 driver.execute_script("mobile: tap", {"touchCount":"1", "x":67, "y":100})2217 sleep(2)2218 #ç»å½é¡µé¢2219 mobile_no=driver.find_elements_by_class_name('XCUIElementTypeTextField')[0]2220 mobile_no.click()2221 sleep(1)2222 mobile_no.send_keys('98762648198')2223 sleep(1)2224 code=driver.find_elements_by_class_name('XCUIElementTypeTextField')[1]2225 code.click()2226 sleep(1)2227 code.send_keys('112233')2228 sleep(1)2229 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="注å/ç»å½"]').click()2230 sleep(7)2231 #æå2232 driver.find_element_by_accessibility_id('æå').click()2233 sleep(5)2234 #æ£æ¥å¥½å'Sam8198'æ¯å¦æ¶å°@éç¥2235 fb=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"@äºä½ ")]')2236 if len(fb) != 0:2237 print('好åæ¶å°@éç¥æ£æ¥éè¿')2238 else:2239 print('好åæ¶å°@éç¥æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2240 now=time.strftime('%Y-%m-%d %H_%M_%S')2241 sf2='../../test_report/ios/'+now+'_error#friend_R_tc033.png'2242 driver.get_screenshot_as_file(sf2)2243 sleep(2)2244 #relogin2245 bp_is_loggedin(self)2246 sleep(1)2247 bp_normalloginmp(self)2248 sleep(2)2249 """2250 else:2251 print('åæ¤å»æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2252 sleep(1)2253 now=time.strftime('%Y-%m-%d %H_%M_%S')2254 print('TC_åç°_åå¸æ¤å»å¹¶@好å----ç»æ:'+now)2255#*******************************************************2256#TC Name:test_faxian_ugcshare_tc0342257#Purpose:æ£æ¥åç°é¡µé¢æ¤å»tabä¸çugcçå享åè½2258#OS:iOS2259#Device:iPhone72260#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2261#Post-conditions:N/A2262#Modify History:created by Sam [2018/08/24]2263#*******************************************************2264 def test_faxian_ugcshare_tc034(self):2265 driver=self.driver2266 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åç°é¡µé¢æ¤å»tabä¸çugcçå享åè½----step1è¿å
¥åç°é¡µé¢æ¤å»tab')2267 print('step2æ£æ¥ugcæ¯å¦åå¨ï¼step3è¿å
¥ugc页é¢ç¹å³ä¸è§çå享æé®ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')2268 print('step5æ£æ¥å享æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享æ°æµªå¾®ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享æçæååè½æ¯å¦æ£å¸¸')2269 now=time.strftime('%Y-%m-%d %H_%M_%S')2270 print('TC_åç°_æ¤å»tabä¸çugcçå享åè½----å¼å§:'+now)2271 sleep(2)2272 driver.find_element_by_accessibility_id('è¿å').click()2273 sleep(2)2274 #æ¤å»2275 driver.find_element_by_accessibility_id('æ¤å»').click()2276 sleep(3)2277 u=driver.find_elements_by_class_name('XCUIElementTypeCell')2278 if len(u) != 0:2279 print('UGCåå¨ï¼æ£æ¥éè¿')2280 sleep(2)2281 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':200,'duration':1.0})2282 #sleep(2)2283 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()2284 sleep(2)2285 #...more icon åæ¥2286 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()2287 sleep(2)2288 #微信2289 wh=driver.find_elements_by_accessibility_id('微信')2290 if len(wh) != 0:2291 print('å享å°å¾®ä¿¡æé®åå¨ï¼æ£æ¥éè¿')2292 sleep(2)2293 driver.find_element_by_accessibility_id('微信').click()2294 sleep(8)2295 driver.find_element_by_accessibility_id('çå°é¾').click()2296 sleep(3)2297 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')2298 sleep(2)2299 if len(words) != 0:2300 words[0].click()2301 sleep(1)2302 now0=time.strftime('%Y-%m-%d %H_%M_%S')2303 words[0].send_keys('æç¨Python_UGC微信好å:'+now0)2304 sleep(1)2305 #åé2306 driver.find_element_by_accessibility_id('åé').click()2307 sleep(1)2308 driver.find_element_by_accessibility_id('è¿åèæ¥').click()2309 sleep(1)2310 #æ£æ¥toast2311 save1=driver.find_elements_by_accessibility_id('å享æå')2312 if len(save1) != 0:2313 print('å享微信æå')2314 else:2315 print('å享微信失败ï¼è¯·æ£æ¥åå ')2316 sleep(1)2317 now=time.strftime('%Y-%m-%d %H_%M_%S')2318 sf1='../../test_report/ios/'+now+'_errorsharewechat_R_stg_tc034.png'2319 driver.get_screenshot_as_file(sf1)2320 sleep(1)2321 else:2322 print('å享å°å¾®ä¿¡æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2323 sleep(2)2324 #...2325 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()2326 sleep(2)2327 #æåå2328 pyq=driver.find_elements_by_accessibility_id('æåå')2329 if len(pyq) != 0:2330 print('å享å°æååæé®åå¨ï¼æ£æ¥éè¿')2331 sleep(2)2332 driver.find_element_by_accessibility_id('æåå').click()2333 sleep(8)2334 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')2335 word2.click()2336 sleep(1)2337 now2=time.strftime('%Y-%m-%d %H_%M_%S')2338 word2.send_keys('æç¨Python_UGCæåå:'+now2)2339 sleep(1)2340 driver.find_element_by_accessibility_id('表æ
').click()2341 sleep(1)2342 driver.find_element_by_accessibility_id('å®æ').click()2343 sleep(2)2344 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()2345 sleep(1)2346 #ç§å¯, ä»
èªå·±å¯è§2347 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()2348 sleep(1)2349 driver.find_element_by_accessibility_id('å®æ').click()2350 sleep(2)2351 #å表2352 driver.find_element_by_accessibility_id('å表').click()2353 sleep(1)2354 #æ£æ¥toast2355 save2=driver.find_elements_by_accessibility_id('å享æå')2356 if len(save2) != 0:2357 print('å享æååæå')2358 else:2359 print('å享æåå失败ï¼è¯·æ£æ¥åå ')2360 sleep(1)2361 now=time.strftime('%Y-%m-%d %H_%M_%S')2362 sf2='../../test_report/ios/'+now+'_errorsharewechatpyq_R_tc034.png'2363 driver.get_screenshot_as_file(sf2)2364 sleep(2)2365 else:2366 print('å享å°æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2367 sleep(1)2368 #...2369 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()2370 sleep(2)2371 #å¾®å2372 wb=driver.find_elements_by_accessibility_id('å¾®å')2373 if len(wb) != 0:2374 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')2375 sleep(2)2376 driver.find_element_by_accessibility_id('å¾®å').click()2377 sleep(8)2378 driver.find_element_by_accessibility_id('åéå°åç»').click()2379 sleep(2)2380 #ä»
èªå·±å¯è§2381 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()2382 sleep(2)2383 #åé2384 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()2385 sleep(0.2)2386 #æ£æ¥toast2387 save3=driver.find_elements_by_accessibility_id('å享æå')2388 if len(save3) != 0:2389 print('å享微åæå')2390 else:2391 print('å享微å失败ï¼è¯·æ£æ¥åå ')2392 sleep(1)2393 now=time.strftime('%Y-%m-%d %H_%M_%S')2394 sf3='../../test_report/ios/'+now+'_errorsharewebo_R_stg_tc034.png'2395 driver.get_screenshot_as_file(sf3)2396 sleep(2)2397 else:2398 print('å享å°å¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2399 sleep(2)2400 #...2401 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()2402 sleep(2)2403 #æçæå2404 mf=driver.find_elements_by_accessibility_id('æçæå')2405 if len(mf) != 0:2406 print('å享å°æçæåæé®åå¨ï¼æ£æ¥éè¿')2407 sleep(2)2408 driver.find_element_by_accessibility_id('æçæå').click()2409 sleep(2)2410 driver.find_element_by_accessibility_id('æå').click()2411 sleep(2)2412 #Sam82012413 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam8")]')[0].click()2414 sleep(1)2415 #åé2416 #æ£æ¥toast2417 save4=driver.find_elements_by_accessibility_id('å享æå')2418 if len(save4) != 0:2419 print('å享æçæåæå')2420 else:2421 print('å享æçæå失败ï¼è¯·æ£æ¥åå ')2422 sleep(1)2423 now=time.strftime('%Y-%m-%d %H_%M_%S')2424 sf4='../../test_report/ios'+now+'_errorsharemyfriend_R_stg_tc034.png'2425 driver.get_screenshot_as_file(sf4)2426 sleep(2)2427 else:2428 print('å享å°æçæåæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2429 sleep(2)2430 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="all page back grey icon"]').click()2431 sleep(2)2432 now=time.strftime('%Y-%m-%d %H_%M_%S')2433 print('TC_åç°_æ¤å»tabä¸çugcçå享åè½----ç»æ:'+now)2434#*******************************************************2435#TC Name:test_faxian_ugcdel_tc0352436#Purpose:æ£æ¥åç°é¡µé¢æ¤å»tabä¸çugcçå é¤åè½2437#OS:iOS2438#Device:iPhone72439#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2440#Post-conditions:N/A2441#Modify History:created by Sam [2018/08/27]2442#*******************************************************2443 def test_faxian_ugcdel_tc035(self):2444 driver=self.driver2445 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åç°é¡µé¢æ¤å»tabä¸çugcçå享åè½----step1è¿å
¥åç°é¡µé¢æ¤å»tab')2446 print('step2æ£æ¥ugcæ¯å¦åå¨ï¼step3è¿å
¥ugc页é¢ç¹å³ä¸è§ç...æé®ï¼step4æ£æ¥å é¤æé®æ¯å¦åå¨')2447 print('step5æ£æ¥å é¤ugcåè½æ¯å¦æ£å¸¸')2448 now=time.strftime('%Y-%m-%d %H_%M_%S')2449 print('TC_åç°_æ¤å»tabä¸çugcçå é¤åè½----å¼å§:'+now)2450 sleep(2)2451 driver.find_element_by_accessibility_id('è¿å').click()2452 sleep(2)2453 #æ¤å»2454 driver.find_element_by_accessibility_id('æ¤å»').click()2455 sleep(3)2456 u=driver.find_elements_by_class_name('XCUIElementTypeCell')2457 if len(u) != 0:2458 print('UGCåå¨ï¼æ£æ¥éè¿')2459 sleep(2)2460 my=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="SamSTG"]')2461 sleep(2)2462 #print(len(my))2463 if len(my) != 0:2464 driver.find_element_by_accessibility_id('SamSTG').click()2465 sleep(2)2466 #åå享æé®å并2467 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="icon share gray background new"]').click()2468 sleep(2)2469 #å é¤2470 d=driver.find_elements_by_accessibility_id('å é¤')2471 if len(d) != 0:2472 print('å é¤æé®åå¨ï¼æ£æ¥éè¿')2473 sleep(2)2474 driver.find_element_by_accessibility_id('å é¤').click()2475 sleep(1)2476 driver.find_element_by_accessibility_id('确认').click()2477 sleep(1)2478 #æ£æ¥toast2479 save1=driver.find_elements_by_accessibility_id('å é¤æå')2480 if len(save1) != 0:2481 print('å é¤ugcæå')2482 else:2483 print('å é¤ugc失败ï¼è¯·æ£æ¥åå ')2484 now=time.strftime('%Y-%m-%d %H_%M_%S')2485 sf1='../../test_report/ios/'+now+'_errorDelUgc_R_stg_tc035.png'2486 driver.get_screenshot_as_file(sf1)2487 sleep(2)2488 else:2489 print('å é¤æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2490 sleep(2)2491 else:2492 print('ä¸æ¯æ¬äººåå¸çugcï¼æ²¡æå é¤çæé')2493 sleep(2)2494 else:2495 print('UGCä¸åå¨,æ æ³æ§è¡å é¤æä½')2496 sleep(2)2497 now=time.strftime('%Y-%m-%d %H_%M_%S')2498 print('TC_åç°_æ¤å»tabä¸çugcçå é¤åè½----ç»æ:'+now)2499#*******************************************************2500#TC Name:test_pengyou_im_tc0362501#Purpose:æ£æ¥æå页é¢IMè天信æ¯å¤å¶ãå é¤ãæ¤åã转å2502#OS:iOS2503#Device:iPhone72504#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2505#Post-conditions:N/A2506#Modify History:created by Sam [2018/08/30]2507#*******************************************************2508 def test_pengyou_im_tc036(self):2509 driver=self.driver2510 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå_IMè天信æ¯å¤å¶ãå é¤ãæ¤åã转ååè½----step1æå页é¢æ¾å°ä¸ä¸ªæååèµ·è天')2511 print('step2åéä¸æ¡æ¶æ¯ï¼step3æ£æ¥å¤å¶æ¶æ¯åè½ï¼step4æ£æ¥å é¤æ¶æ¯åè½')2512 print('step5æ£æ¥è½¬åæ¶æ¯åè½;step6æ£æ¥æ¤åæ¶æ¯åè½')2513 now=time.strftime('%Y-%m-%d %H_%M_%S')2514 print('TC_æå_IMè天信æ¯å¤å¶ãå é¤ãæ¤åã转ååè½----å¼å§:'+now)2515 sleep(2)2516 driver.find_element_by_accessibility_id('è¿å').click()2517 sleep(2)2518 #æå2519 driver.find_element_by_accessibility_id('æå').click()2520 sleep(5)2521 driver.find_element_by_xpath('//XCUIElementTypeNavigationBar[@name="æå"]/XCUIElementTypeButton').click()2522 sleep(2)2523 u=driver.find_elements_by_class_name('XCUIElementTypeCell')2524 if len(u) != 0:2525 driver.find_elements_by_class_name('XCUIElementTypeCell')[0].click()2526 sleep(3)2527 #è天2528 driver.find_element_by_accessibility_id('è天').click()2529 sleep(2)2530 #åéææ¬ä¿¡æ¯2531 word=driver.find_element_by_accessibility_id('chat_input_textView')2532 word.click()2533 sleep(1)2534 word.send_keys('æµè¯im')2535 sleep(1)2536 #åé2537 driver.find_element_by_accessibility_id('Send').click()2538 sleep(2)2539 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':100, 'y':200})2540 sleep(1)2541 #é¿æim2542 d=driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯im"]')2543 driver.execute_script('mobile: touchAndHold',{'element':d,'duration':1.0})2544 sleep(1)2545 #å¤å¶2546 cp=driver.find_elements_by_accessibility_id('å¤å¶')2547 if len(cp) != 0:2548 print('å¤å¶æ¶æ¯æé®åå¨ï¼æ£æ¥éè¿')2549 sleep(2)2550 driver.find_element_by_accessibility_id('å¤å¶').click()2551 sleep(1)2552 word.click()2553 sleep(1)2554 driver.execute_script('mobile: touchAndHold',{'element':word,'duration':1.0})2555 sleep(1)2556 #ç²è´´2557 driver.find_element_by_accessibility_id('ç²è´´').click()2558 sleep(1)2559 driver.find_element_by_accessibility_id('Send').click()2560 sleep(1)2561 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':100, 'y':200})2562 sleep(1)2563 #æ£æ¥2564 c=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯im"]')2565 #print(len(c))2566 if len(c) != 1:2567 print('å¤å¶æ¶æ¯æå')2568 else:2569 print('å¤å¶æ¶æ¯å¤±è´¥ï¼è¯·æ£æ¥åå ')2570 sleep(2)2571 else:2572 print('å¤å¶æ¶æ¯æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2573 sleep(2)2574 #é¿æim2575 d=driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯im"]')2576 driver.execute_script('mobile: touchAndHold',{'element':d,'duration':1.0})2577 sleep(1)2578 #å é¤æ¶æ¯2579 de=driver.find_elements_by_accessibility_id('å é¤')2580 if len(de) != 0:2581 print('å é¤æ¶æ¯æé®åå¨ï¼æ£æ¥éè¿')2582 sleep(2)2583 driver.find_element_by_accessibility_id('å é¤').click()2584 sleep(1)2585 #æ£æ¥2586 c2=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯im"]')2587 #print(len(c2))2588 if len(c2) == 1:2589 print('å é¤æ¶æ¯æå')2590 else:2591 print('å é¤æ¶æ¯å¤±è´¥ï¼è¯·æ£æ¥åå ')2592 sleep(2)2593 else:2594 print('å é¤æ¶æ¯æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2595 sleep(2)2596 #é¿æim2597 d=driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯im"]')2598 driver.execute_script('mobile: touchAndHold',{'element':d,'duration':1.0})2599 sleep(1)2600 #转åæ¶æ¯2601 de=driver.find_elements_by_accessibility_id('转å')2602 if len(de) != 0:2603 print('转åæ¶æ¯æé®åå¨ï¼æ£æ¥éè¿')2604 sleep(2)2605 driver.find_element_by_accessibility_id('转å').click()2606 sleep(1)2607 driver.find_element_by_accessibility_id('æå').click()2608 sleep(1)2609 fri=driver.find_elements_by_class_name('XCUIElementTypeCell')2610 if len(fri) != 0:2611 #1nd friend2612 driver.find_elements_by_class_name('XCUIElementTypeCell')[1].click()2613 else:2614 print('没æå
¶ä»æåå¯ä»¥è½¬åæ¶æ¯')2615 sleep(1)2616 driver.find_element_by_accessibility_id('all page back black icon').click()2617 sleep(2)2618 driver.find_element_by_accessibility_id('all page back black icon').click()2619 sleep(2)2620 else:2621 print('转åæ¶æ¯æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2622 sleep(2)2623 #æ°åä¸æ¡im2624 word.click()2625 sleep(1)2626 word.send_keys('æµè¯æ¤åim')2627 sleep(1)2628 #åé2629 driver.find_element_by_accessibility_id('Send').click()2630 sleep(1)2631 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':100, 'y':200})2632 sleep(1)2633 #é¿æim2634 d=driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="æµè¯æ¤åim"]')2635 driver.execute_script('mobile: touchAndHold',{'element':d,'duration':1.0})2636 sleep(1)2637 #æ¤åæ¶æ¯2638 wd=driver.find_elements_by_accessibility_id('æ¤å')2639 if len(wd) != 0:2640 print('æ¤åæ¶æ¯æé®åå¨ï¼æ£æ¥éè¿')2641 sleep(2)2642 driver.find_element_by_accessibility_id('æ¤å').click()2643 sleep(1)2644 #æ£æ¥2645 w=driver.find_elements_by_accessibility_id('ä½ æ¤åäºä¸æ¡æ¶æ¯')2646 if len(w) != 0:2647 print('æ¤åæ¶æ¯æå')2648 else:2649 print('æ¤åæ¶æ¯å¤±è´¥ï¼è¯·æ£æ¥åå ')2650 sleep(2)2651 else:2652 print('æ¤åæ¶æ¯æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2653 sleep(2)2654 driver.find_element_by_accessibility_id('all page back black icon').click()2655 sleep(1)2656 else:2657 print('æåä¸åå¨ï¼æ æ³æ§è¡è天ç¸å
³æä½')2658 sleep(2)2659 now=time.strftime('%Y-%m-%d %H_%M_%S')2660 print('TC_æå_IMè天信æ¯å¤å¶ãå é¤ãæ¤åã转ååè½----ç»æ:'+now)2661 2662#*******************************************************2663#TC Name:test_faxian_infopgcshare_tc0372664#Purpose:æ£æ¥åç°é¡µé¢èµè®¯tabä¸çpgcçå享åè½2665#OS:iOS2666#Device:iPhone72667#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2668#Post-conditions:N/A2669#Modify History:created by Sam [2018/08/29]2670#*******************************************************2671 def test_faxian_infopgcshare_tc037(self):2672 driver=self.driver2673 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åç°é¡µé¢èµè®¯tabä¸çpgcçå享åè½----step1è¿å
¥åç°é¡µé¢èµè®¯tab')2674 print('step2PGCçUIæ£æ¥ï¼step3è¿å
¥pgcæç« é¡µé¢ç¹å³ä¸è§çå享æé®ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')2675 print('step5æ£æ¥å享æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享æ°æµªå¾®ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享æçæååè½æ¯å¦æ£å¸¸')2676 now=time.strftime('%Y-%m-%d %H_%M_%S')2677 print('TC_åç°_åç°é¡µé¢èµè®¯tabä¸çPGCçå享åè½----å¼å§:'+now)2678 sleep(2)2679 driver.find_element_by_accessibility_id('è¿å').click()2680 sleep(2)2681 driver.find_element_by_accessibility_id('èµè®¯').click()2682 sleep(3)2683 """2684 for i in range(4):2685 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':45,'duration':1.0})2686 sleep(2)2687 #driver.execute_script("mobile: scroll", {"direction": "down"})2688 sleep(2)2689 """2690 #æ£æ¥åç°é¡µé¢èµè®¯tabä¸çpgcççå个å
ç´ æ¯å¦åå¨2691 c=fun_pgcui_check(self)2692 if c == True:2693 print('åç°é¡µé¢èµè®¯tabä¸çpgcçå个被æ£æ¥å
ç´ é½æ£æ¥å®æ¯')2694 sleep(1)2695 u=driver.find_elements_by_class_name('XCUIElementTypeCell')2696 if len(u) != 0:2697 print('PGCåå¨ï¼æ£æ¥éè¿')2698 sleep(2)2699 driver.find_element_by_accessibility_id('å°é¾æ票stg').click()2700 sleep(6)2701 #å·¦ä¸è§æé®2702 sh=driver.find_elements_by_xpath('(//XCUIElementTypeOther[@name="å°é¾æ票stg"])[1]/XCUIElementTypeOther[2]')2703 if len(sh) != 0:2704 print('å享æé®åå¨ï¼æ£æ¥éè¿')2705 sleep(2)2706 #driver.find_element_by_xpath('(//XCUIElementTypeOther[@name="æµè¯æç« æ¹ç - 1"])[1]/XCUIElementTypeOther[2]').click()2707 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':343, 'y':42})2708 sleep(2)2709 #微信2710 wh=driver.find_elements_by_accessibility_id('微信')2711 if len(wh) != 0:2712 print('å享å°å¾®ä¿¡æé®åå¨ï¼æ£æ¥éè¿')2713 sleep(2)2714 driver.find_element_by_accessibility_id('微信').click()2715 sleep(6)2716 driver.find_element_by_accessibility_id('çå°é¾').click()2717 sleep(3)2718 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')2719 sleep(2)2720 if len(words) != 0:2721 words[0].click()2722 sleep(1)2723 now0=time.strftime('%Y-%m-%d %H_%M_%S')2724 words[0].send_keys('人çè¦çPGC微信好å:'+now0)2725 sleep(1)2726 #åé2727 driver.find_element_by_accessibility_id('åé').click()2728 sleep(2)2729 driver.find_element_by_accessibility_id('è¿åèæ¥').click()2730 sleep(1)2731 #æ£æ¥toast2732 save1=driver.find_elements_by_accessibility_id('å享æå')2733 if len(save1) != 0:2734 print('å享微信好åæå')2735 sleep(1)2736 else:2737 print('å享微信好å失败ï¼è¯·æ£æ¥åå ')2738 sleep(1)2739 now=time.strftime('%Y-%m-%d %H_%M_%S')2740 sf1='../../test_report/ios/'+now+'_errorPGCsharewechat_R_stg_tc037.png'2741 driver.get_screenshot_as_file(sf1)2742 sleep(2)2743 else:2744 print('å享å°å¾®ä¿¡å¥½åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2745 sleep(2)2746 #share2747 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':343, 'y':42})2748 sleep(2)2749 #æåå2750 pyq=driver.find_elements_by_accessibility_id('æåå')2751 if len(pyq) != 0:2752 print('å享å°æååæé®åå¨ï¼æ£æ¥éè¿')2753 sleep(1)2754 driver.find_element_by_accessibility_id('æåå').click()2755 sleep(8)2756 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')2757 word2.click()2758 sleep(1)2759 now2=time.strftime('%Y-%m-%d %H_%M_%S')2760 word2.send_keys('人çè¦çPGCæåå:'+now2)2761 sleep(1)2762 driver.find_element_by_accessibility_id('表æ
').click()2763 sleep(1)2764 driver.find_element_by_accessibility_id('å®æ').click()2765 sleep(2)2766 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()2767 sleep(1)2768 #ç§å¯, ä»
èªå·±å¯è§2769 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()2770 sleep(1)2771 driver.find_element_by_accessibility_id('å®æ').click()2772 sleep(2)2773 #å表2774 driver.find_element_by_accessibility_id('å表').click()2775 sleep(1)2776 #æ£æ¥toast2777 save2=driver.find_elements_by_accessibility_id('å享æå')2778 if len(save2) != 0:2779 print('å享æååæå')2780 sleep(1)2781 else:2782 print('å享æåå失败ï¼è¯·æ£æ¥åå ')2783 sleep(1)2784 now=time.strftime('%Y-%m-%d %H_%M_%S')2785 sf2='../../test_report/ios/'+now+'_errorPGCsharewechatpyq_R_stg_tc037.png'2786 driver.get_screenshot_as_file(sf2)2787 sleep(1)2788 else:2789 print('å享å°æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2790 sleep(2)2791 #share2792 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':343, 'y':42})2793 sleep(2)2794 #å¾®å2795 wb=driver.find_elements_by_accessibility_id('å¾®å')2796 if len(wb) != 0:2797 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')2798 sleep(2)2799 driver.find_element_by_accessibility_id('å¾®å').click()2800 sleep(8)2801 driver.find_element_by_accessibility_id('åéå°åç»').click()2802 sleep(2)2803 #ä»
èªå·±å¯è§2804 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()2805 sleep(2)2806 #åé2807 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()2808 sleep(1)2809 #æ£æ¥toast2810 save3=driver.find_elements_by_accessibility_id('å享æå')2811 if len(save3) != 0:2812 print('å享微åæå')2813 sleep(1)2814 else:2815 print('å享微å失败ï¼è¯·æ£æ¥åå ')2816 sleep(1)2817 now=time.strftime('%Y-%m-%d %H_%M_%S')2818 sf3='../../test_report/ios/'+now+'_errorPGCsharewebo_R_stg_tc037.png'2819 driver.get_screenshot_as_file(sf3)2820 sleep(1)2821 else:2822 print('å享å°æ°æµªå¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2823 sleep(2)2824 #share2825 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':343, 'y':42})2826 sleep(2)2827 #æçæå2828 mf=driver.find_elements_by_accessibility_id('æçæå')2829 if len(mf) != 0:2830 print('å享å°æçæåæé®åå¨ï¼æ£æ¥éè¿')2831 sleep(2)2832 driver.find_element_by_accessibility_id('æçæå').click()2833 sleep(2)2834 driver.find_element_by_accessibility_id('æå').click()2835 sleep(2)2836 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()2837 sleep(1)2838 #æ£æ¥toast2839 save4=driver.find_elements_by_accessibility_id('å享æå')2840 if len(save4) != 0:2841 print('å享æçæåæå')2842 sleep(1)2843 else:2844 print('å享æçæå失败ï¼è¯·æ£æ¥åå ')2845 sleep(1)2846 now=time.strftime('%Y-%m-%d %H_%M_%S')2847 sf4='../../test_report/ios/'+now+'_errorPGCsharemyfriend_R_stg_tc037.png'2848 driver.get_screenshot_as_file(sf4)2849 sleep(1)2850 else:2851 print('å享å°æçæåæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2852 sleep(2)2853 else:2854 print('å享æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')2855 sleep(2)2856 #driver.find_element_by_xpath('(//XCUIElementTypeOther[@name="å°é¾æ票stg"])[1]/XCUIElementTypeOther[1]').click()2857 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':32, 'y':42})2858 sleep(2)2859 else:2860 print('PGCä¸åå¨ï¼æ æ³æ§è¡å享æä½')2861 sleep(2)2862 now=time.strftime('%Y-%m-%d %H_%M_%S')2863 print('TC_åç°_åç°é¡µé¢èµè®¯tabä¸çPGCçå享åè½----ç»æ:'+now)2864#*******************************************************2865#TC Name:test_faxian_experjoin_tc0382866#Purpose:åç°é¡µé¢ä½éªtabæ´»å¨çæ¥ååè½2867#OS:iOS2868#Device:iPhone72869#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app2870#Post-conditions:N/A2871#Modify History:created by Sam [2018/09/30]2872#*******************************************************2873 def test_faxian_experjoin_tc038(self):2874 driver=self.driver2875 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°ââä½éªtabæ´»å¨çæ¥ååè½---step1åç°é¡µé¢éç¹å»ä½éªtab')2876 print('step2åæ¢å°ç¹æ¾å°ä¸ä¸ªååæ´»å¨ï¼step3æ£æ¥æ¥ååè½æ¯å¦æ£å¸¸;step4è¿å
¥æç->æçæ´»å¨é¡µé¢')2877 print('step5ç¹å»æ¥çè¡ç¨å;step6æ£æ¥æ´»å¨è®¢åéæ´»å¨çæ¶é´æ¯å¦æ£ç¡®')2878 now=time.strftime('%Y-%m-%d %H_%M_%S')2879 print('TC_åç°ââä½éªtabæ´»å¨çæ¥ååè½----å¼å§:'+now)2880 sleep(1)2881 driver.find_element_by_accessibility_id('è¿å').click()2882 sleep(1)2883 #ä½éª2884 driver.find_element_by_accessibility_id('ä½éª').click()2885 sleep(5)2886 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeButton[2]').click()2887 sleep(2)2888 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':150,'duration':1.0})2889 #sleep(2)2890 driver.find_element_by_accessibility_id('èæ¥ä¸å¿ä¸¨ä¸æµ·å¤ªå¤æ±åº1112121312').click()2891 sleep(2)2892 for i in range(2):2893 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':50,'duration':1.0})2894 sleep(2)2895 sleep(2)2896 #page=driver.page_source2897 #sleep(2)2898 #èªå¨åæµè¯æ´»å¨12899 driver.find_element_by_accessibility_id('å°é¾èªå¨å2').click()2900 sleep(8)2901 page=driver.page_source2902 sleep(2)2903 #æ¥å2904 joins=driver.find_elements_by_xpath('//XCUIElementTypeLink[@name="æ¥å"]')2905 sleep(2)2906 if len(joins) != 0:2907 print('æ¥åæé®åå¨,æ£æ¥éè¿')2908 sleep(2)2909 driver.find_element_by_xpath('//XCUIElementTypeLink[@name="æ¥å"]').click()2910 sleep(4)2911 #åºæ¬¡2912 #driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="10.28 / 00:00"]').click()2913 #sleep(1)2914 #driver.find_element_by_xpath('//XCUIElementTypeStaticText[contains(@name,"ç¨çåæ´»å¨")]').click()2915 #sleep(2)2916 #+éè´1å¼ 2917 #driver.find_element_by_xpath('//XCUIElementTypeButton[@name="+"]').click()2918 #sleep(1)2919 driver.execute_script('mobile: dragFromToForDuration',{'fromX':350,'fromY':550,'toX':350,'toY':50,'duration':1.0})2920 sleep(2)2921 #å§å2922 name=driver.find_elements_by_class_name('XCUIElementTypeTextField')[0]2923 name.click()2924 name.send_keys('çé¶æ³')2925 sleep(1)2926 driver.find_element_by_accessibility_id('å®æ').click()2927 sleep(1)2928 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="æ§å«"]').click()2929 sleep(1)2930 #ç¡®å®2931 driver.find_element_by_xpath('//XCUIElementTypeButton[contains(@name,"ç¡®å®")]').click()2932 sleep(2)2933 #mobile2934 mb=driver.find_elements_by_class_name('XCUIElementTypeTextField')[1]2935 mb.click()2936 sleep(1)2937 mb.send_keys('18930018802')2938 sleep(1)2939 driver.find_element_by_accessibility_id('å®æ').click()2940 sleep(1)2941 #è¯ä»¶ç±»å«2942 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="è¯ä»¶ç±»å«"]').click()2943 sleep(1)2944 #ç¡®å®2945 driver.find_element_by_xpath('//XCUIElementTypeButton[contains(@name,"ç¡®å®")]').click()2946 sleep(2)2947 #è¯ä»¶å·ç 2948 em=driver.find_elements_by_class_name('XCUIElementTypeTextField')[2]2949 em.click()2950 sleep(1)2951 em.send_keys('340103197301142518')2952 sleep(1)2953 driver.find_element_by_accessibility_id('å®æ').click()2954 sleep(2)2955 #è´ä¹°2956 driver.find_element_by_accessibility_id('è´ä¹°').click()2957 sleep(1)2958 #确认2959 driver.find_element_by_accessibility_id('确认').click()2960 sleep(3)2961 #checking2962 ch=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="é¢çº¦æå"]')2963 if len(ch) == 0:2964 print('æ¥å失败ï¼è¯·æ£æ¥åå ')2965 now=time.strftime('%Y-%m-%d %H_%M_%S')2966 sf1='../../test_report/ios/'+now+'_errorJoin_R_tc038.png'2967 driver.get_screenshot_as_file(sf1)2968 sleep(2)2969 else:2970 print('æ¥åæå')2971 sleep(1)2972 driver.find_element_by_accessibility_id('å®æ').click()2973 sleep(5)2974 #driver.find_element_by_xpath('//XCUIElementTypeOther[@name="èæ¥"]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]').click()2975 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':30, 'y':22})2976 sleep(3)2977 #driver.find_element_by_xpath('//XCUIElementTypeOther[@name="èæ¥"]/XCUIElementTypeOther[1]').click()2978 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':32, 'y':42})2979 sleep(2)2980 #driver.find_element_by_accessibility_id('all page back black icon').click()2981 #driver.execute_script('mobile: tap', {'touchCount':'1', 'x':27, 'y':42})2982 #sleep(2)2983 #æç2984 driver.find_element_by_accessibility_id('æç').click()2985 sleep(3)2986 driver.find_element_by_accessibility_id('æçæ´»å¨').click()2987 sleep(3)2988 ch2=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@value,"2æ4æ¥")]')2989 if len(ch2) != 0:2990 print('æ´»å¨è®¢åéæ´»å¨æ¶é´æ£æ¥éè¿')2991 sleep(1)2992 else:2993 print('æ´»å¨è®¢åéæ´»å¨æ¶é´æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')2994 sleep(1)2995 now=time.strftime('%Y-%m-%d %H_%M_%S')2996 sf2='../../test_report/ios/'+now+'_errorMyActivity_R_stg_tc038.png'2997 driver.get_screenshot_as_file(sf2)2998 sleep(2)2999 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="all page back black icon"]').click()3000 sleep(2)3001 else:3002 print('æ¥åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3003 sleep(2)3004 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':32, 'y':42})3005 sleep(2)3006 now=time.strftime('%Y-%m-%d %H_%M_%S')3007 print('TC_åç°ââä½éªtabæ´»å¨çæ¥ååè½----ç»æ:'+now)3008#*******************************************************3009#TC Name:test_wode_canceljoin_tc0393010#Purpose:æç页é¢æçæ´»å¨éåæ¶æ¥åçåè½3011#OS:iOS3012#Device:iPhone73013#Post-conditions:N/A3014#Modify History:created by Sam [2018/09/30]3015#*******************************************************3016 def test_wode_canceljoin_tc039(self):3017 driver=self.driver3018 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:å·²ç»å½è´¦å·åç°ââæç页é¢æçæ´»å¨éåæ¶æ¥åçåè½---step1è¿å
¥æç->æçæ´»å¨é¡µé¢')3019 print('step2ç¹å»æ¥çè¡ç¨åï¼step3æ£æ¥åæ¶æ¥åæé®æ¯å¦åå¨;step4æ£æ¥åæ¶æ¥ååè½æ¯å¦æ£å¸¸')3020 print('step5æ£æ¥æ´»å¨è®¢åéæ¯å¦ææ æ´»å¨é¢çº¦')3021 now=time.strftime('%Y-%m-%d %H_%M_%S')3022 print('TC_æçââæçæ´»å¨éåæ¶æ¥åçåè½----å¼å§:'+now)3023 sleep(2)3024 driver.find_element_by_accessibility_id('è¿å').click()3025 sleep(2)3026 #æç3027 driver.find_element_by_accessibility_id('æç').click()3028 sleep(4)3029 #æçæ´»å¨3030 driver.find_element_by_accessibility_id('æçæ´»å¨').click()3031 sleep(3)3032 ch=driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="åæ¶æ¥å"]')3033 if len(ch) != 0:3034 print('åæ¶æ¥åæé®åå¨ï¼æ£æ¥éè¿')3035 sleep(1)3036 driver.find_element_by_accessibility_id('åæ¶æ¥å').click()3037 sleep(1)3038 #æ¯3039 driver.find_element_by_accessibility_id('æ¯').click()3040 sleep(1)3041 #checking3042 ch1=driver.find_elements_by_accessibility_id('åæ¶æå')3043 if len(ch1) != 0:3044 print('åæ¶æ¥åæå')3045 sleep(4)3046 driver.find_element_by_accessibility_id('all page back black icon').click()3047 sleep(2)3048 #æçæ´»å¨3049 driver.find_element_by_accessibility_id('æçæ´»å¨').click()3050 sleep(4)3051 #ææ æ´»å¨é¢çº¦3052 ch2=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="å°é¾èªå¨å2"]')3053 if len(ch2) == 0:3054 print('æçé¢çº¦æ´»å¨å·²åæ¶æ¥åï¼æ£æ¥éè¿')3055 sleep(1)3056 else:3057 print('æçé¢çº¦æ´»å¨åæ¶æ¥å失败ï¼è¯·æ£æ¥åå ')3058 sleep(1)3059 now=time.strftime('%Y-%m-%d %H_%M_%S')3060 sf0='../../test_report/ios/'+now+'_errorActivityList_R.png'3061 driver.get_screenshot_as_file(sf0)3062 sleep(2)3063 driver.find_element_by_accessibility_id('all page back black icon').click()3064 sleep(2)3065 else:3066 print('åæ¶æ¥å失败ï¼è¯·æ£æ¥åå ')3067 sleep(1)3068 now=time.strftime('%Y-%m-%d %H_%M_%S')3069 sf1='../../test_report/ios/'+now+'_errorCancel_R_stg_tc039.png'3070 driver.get_screenshot_as_file(sf1)3071 sleep(2)3072 else:3073 print('åæ¶æ¥åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3074 sleep(1)3075 now=time.strftime('%Y-%m-%d %H_%M_%S')3076 sf2='../../test_report/ios/'+now+'_errorNoCancelJoin_R_stg_tc039.png'3077 driver.get_screenshot_as_file(sf2)3078 sleep(2)3079 driver.find_element_by_accessibility_id('all page back black icon').click()3080 sleep(2)3081 now=time.strftime('%Y-%m-%d %H_%M_%S')3082 print('TC_æçââæçæ´»å¨éåæ¶æ¥åçåè½----ç»æ:'+now)3083#*******************************************************3084#TC Name:test_faxian_expershare_tc0403085#Purpose:æ£æ¥åç°é¡µé¢èµè®¯tabä¸çpgcçå享åè½3086#OS:iOS3087#Device:iPhone73088#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app3089#Post-conditions:N/A3090#Modify History:created by Sam [2018/09/30]3091#*******************************************************3092 def test_faxian_expershare_tc040(self):3093 driver=self.driver3094 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:åç°_åç°é¡µé¢ä½éªtabä¸çæ´»å¨çå享åè½----step1è¿å
¥åç°é¡µé¢ä½éªtab')3095 print('step2æ¾å°æ´»å¨è¿å
¥ï¼step3æ£æ¥å¹¶ç¹å³ä¸è§çå享æé®ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')3096 print('step5æ£æ¥å享æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享æ°æµªå¾®ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享æçæååè½æ¯å¦æ£å¸¸')3097 now=time.strftime('%Y-%m-%d %H_%M_%S')3098 print('TC_åç°_åç°é¡µé¢ä½éªtabä¸çæ´»å¨çå享åè½----å¼å§:'+now)3099 sleep(1)3100 driver.find_element_by_accessibility_id('è¿å').click()3101 sleep(1)3102 #ä½éª3103 driver.find_element_by_accessibility_id('ä½éª').click()3104 sleep(4)3105 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeButton[2]').click()3106 sleep(2)3107 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':150,'duration':1.0})3108 #sleep(2)3109 driver.find_element_by_accessibility_id('èæ¥ä¸å¿ä¸¨ä¸æµ·å¤ªå¤æ±åº1112121312').click()3110 sleep(2)3111 driver.find_element_by_accessibility_id('æ°æ´»å¨_9.7stg1').click()3112 sleep(6)3113 page=driver.page_source3114 sleep(2)3115 #å享å¾æ 3116 share=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="èæ¥"]/XCUIElementTypeOther[3]')3117 sleep(2)3118 if len(share) != 0:3119 print('å享æé®åå¨ï¼æ£æ¥éè¿')3120 sleep(2)3121 #share3122 #driver.find_element_by_ios_class_chain('*/XCUIElementTypeOther[2]').click()3123 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':345, 'y':42})3124 sleep(2)3125 #微信3126 wh=driver.find_elements_by_accessibility_id('微信')3127 if len(wh) != 0:3128 print('å享å°å¾®ä¿¡æé®åå¨ï¼æ£æ¥éè¿')3129 sleep(2)3130 driver.find_element_by_accessibility_id('微信').click()3131 sleep(6)3132 driver.find_element_by_accessibility_id('çå°é¾').click()3133 sleep(3)3134 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')3135 sleep(2)3136 if len(words) != 0:3137 words[0].click()3138 sleep(1)3139 now0=time.strftime('%Y-%m-%d %H_%M_%S')3140 words[0].send_keys('æç¨Python_PGC微信好å:'+now0)3141 sleep(1)3142 #åé3143 driver.find_element_by_accessibility_id('åé').click()3144 sleep(2)3145 driver.find_element_by_accessibility_id('è¿åèæ¥').click()3146 sleep(0.2)3147 #æ£æ¥toast3148 save1=driver.find_elements_by_accessibility_id('å享æå')3149 if len(save1) != 0:3150 print('å享微信好åæå')3151 sleep(1)3152 else:3153 print('å享微信好å失败ï¼è¯·æ£æ¥åå ')3154 sleep(1)3155 now=time.strftime('%Y-%m-%d %H_%M_%S')3156 sf1='../../test_report/ios/'+now+'_errorPGCsharewechat_R_stg_tc040.png'3157 driver.get_screenshot_as_file(sf1)3158 sleep(2)3159 else:3160 print('å享å°å¾®ä¿¡å¥½åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3161 sleep(2)3162 #share3163 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':345, 'y':42})3164 sleep(2)3165 #æåå3166 pyq=driver.find_elements_by_accessibility_id('æåå')3167 if len(pyq) != 0:3168 print('å享å°æååæé®åå¨ï¼æ£æ¥éè¿')3169 sleep(1)3170 driver.find_element_by_accessibility_id('æåå').click()3171 sleep(8)3172 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')3173 word2.click()3174 sleep(1)3175 now2=time.strftime('%Y-%m-%d %H_%M_%S')3176 word2.send_keys('æç¨Python_PGCæåå:'+now2)3177 sleep(1)3178 driver.find_element_by_accessibility_id('表æ
').click()3179 sleep(1)3180 driver.find_element_by_accessibility_id('å®æ').click()3181 sleep(2)3182 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()3183 sleep(1)3184 #ç§å¯, ä»
èªå·±å¯è§3185 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()3186 sleep(1)3187 driver.find_element_by_accessibility_id('å®æ').click()3188 sleep(2)3189 #å表3190 driver.find_element_by_accessibility_id('å表').click()3191 sleep(1)3192 #æ£æ¥toast3193 save2=driver.find_elements_by_accessibility_id('å享æå')3194 if len(save2) != 0:3195 print('å享æååæå')3196 sleep(1)3197 else:3198 print('å享æåå失败ï¼è¯·æ£æ¥åå ')3199 sleep(1)3200 now=time.strftime('%Y-%m-%d %H_%M_%S')3201 sf2='../../test_report/ios/'+now+'_errorPGCsharewechatpyq_R_stg_tc040.png'3202 driver.get_screenshot_as_file(sf2)3203 sleep(1)3204 else:3205 print('å享å°æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3206 sleep(2)3207 #share3208 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':345, 'y':42})3209 sleep(2)3210 #å¾®å3211 wb=driver.find_elements_by_accessibility_id('å¾®å')3212 if len(wb) != 0:3213 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')3214 sleep(2)3215 driver.find_element_by_accessibility_id('å¾®å').click()3216 sleep(8)3217 driver.find_element_by_accessibility_id('åéå°åç»').click()3218 sleep(2)3219 #ä»
èªå·±å¯è§3220 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()3221 sleep(2)3222 #åé3223 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()3224 #sleep(0.2)3225 #æ£æ¥toast3226 save3=driver.find_elements_by_accessibility_id('å享æå')3227 if len(save3) != 0:3228 print('å享微åæå')3229 sleep(1)3230 else:3231 print('å享微å失败ï¼è¯·æ£æ¥åå ')3232 sleep(1)3233 now=time.strftime('%Y-%m-%d %H_%M_%S')3234 sf3='../../test_report/ios/'+now+'_errorPGCsharewebo_R_stg_tc040.png'3235 driver.get_screenshot_as_file(sf3)3236 sleep(1)3237 else:3238 print('å享å°æ°æµªå¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3239 sleep(2)3240 #share3241 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':345, 'y':42})3242 sleep(2)3243 #æçæå3244 mf=driver.find_elements_by_accessibility_id('æçæå')3245 if len(mf) != 0:3246 print('å享å°æçæåæé®åå¨ï¼æ£æ¥éè¿')3247 sleep(1)3248 driver.find_element_by_accessibility_id('æçæå').click()3249 sleep(2)3250 driver.find_element_by_accessibility_id('æå').click()3251 sleep(2)3252 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()3253 sleep(1)3254 #æ£æ¥toast3255 save4=driver.find_elements_by_accessibility_id('å享æå')3256 if len(save4) != 0:3257 print('å享æçæåæå')3258 sleep(1)3259 else:3260 print('å享æçæå失败ï¼è¯·æ£æ¥åå ')3261 sleep(1)3262 now=time.strftime('%Y-%m-%d %H_%M_%S')3263 sf4='../../test_report/ios/'+now+'_errorPGCsharemyfriend_R_stg_tc040.png'3264 driver.get_screenshot_as_file(sf4)3265 sleep(1)3266 else:3267 print('å享å°æçæåæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3268 sleep(2)3269 else:3270 print('å享æé®ä¸åå¨/æªæ¾å°ï¼è¯·æ£æ¥åå ')3271 sleep(2)3272 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':30, 'y':42})3273 sleep(2)3274 now=time.strftime('%Y-%m-%d %H_%M_%S')3275 print('TC_åç°_åç°é¡µé¢ä½éªtabä¸çæ´»å¨çå享åè½----ç»æ:'+now)3276#*******************************************************3277#TC Name:test_jingxi_giftshare_tc0413278#Purpose:æ£æ¥åç°é¡µé¢èµè®¯tabä¸çpgcçå享åè½3279#OS:iOS3280#Device:iPhone73281#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app3282#Post-conditions:N/A3283#Modify History:created by Sam [2018/09/30]3284#*******************************************************3285 def test_jingxi_giftshare_tc041(self):3286 driver=self.driver3287 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æå_æå页é¢çååçå享åè½----step1è¿å
¥æå页é¢')3288 print('step2éæ©ä¸æ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢ï¼step3ç¹å³ä¸è§çå享æé®ï¼å
æ£æ¥æ¯å¦åå¨ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')3289 print('step5æ£æ¥å享æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享æ°æµªå¾®ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享æçæååè½æ¯å¦æ£å¸¸')3290 now=time.strftime('%Y-%m-%d %H_%M_%S')3291 print('TC_æå_æå页é¢çååçå享åè½----å¼å§:'+now)3292 sleep(1)3293 driver.find_element_by_accessibility_id('è¿å').click()3294 sleep(1)3295 #æå3296 driver.find_element_by_accessibility_id('æå').click()3297 sleep(8)3298 for i in range(1):3299 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':350,'duration':1.0})3300 sleep(2)3301 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':350,'duration':1.0})3302 sleep(2)3303 u=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1 车主ä¸äº«"]')3304 if len(u) != 0:3305 print('éè¦å
æ¢çåååå¨ï¼æ£æ¥éè¿')3306 sleep(2)3307 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1 车主ä¸äº«"]').click()3308 sleep(8)3309 #å享å¾æ 3310 share=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="横å¹
"]/XCUIElementTypeOther[2]')3311 sleep(2)3312 if len(share) != 0:3313 print('å享æé®åå¨,æ£æ¥éè¿')3314 sleep(3)3315 #share3316 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':338, 'y':58})3317 sleep(2)3318 #微信3319 wh=driver.find_elements_by_accessibility_id('微信')3320 if len(wh) != 0:3321 print('å享å°å¾®ä¿¡å¥½åæé®åå¨ï¼æ£æ¥éè¿')3322 sleep(2)3323 driver.find_element_by_accessibility_id('微信').click()3324 sleep(9)3325 driver.find_element_by_accessibility_id('çå°é¾').click()3326 sleep(3)3327 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')3328 sleep(2)3329 if len(words) != 0:3330 words[0].click()3331 sleep(1)3332 now0=time.strftime('%Y-%m-%d %H_%M_%S')3333 words[0].send_keys('æç¨Python_Gift微信好å:'+now0)3334 sleep(1)3335 #åé3336 driver.find_element_by_accessibility_id('åé').click()3337 sleep(2)3338 driver.find_element_by_accessibility_id('è¿åèæ¥').click()3339 sleep(1)3340 #æ£æ¥toast3341 save1=driver.find_elements_by_accessibility_id('å享æå')3342 if len(save1) != 0:3343 print('å享微信好åæå')3344 sleep(1)3345 else:3346 print('å享微信好å失败ï¼è¯·æ£æ¥åå ')3347 sleep(1)3348 now=time.strftime('%Y-%m-%d %H_%M_%S')3349 sf1='../../test_report/ios/'+now+'_errorGiftsharewechat_R_stg_tc041.png'3350 driver.get_screenshot_as_file(sf1)3351 sleep(2)3352 else:3353 print('å享å°å¾®ä¿¡å¥½åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3354 sleep(2)3355 #share3356 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':338, 'y':58})3357 sleep(2)3358 #æåå3359 pyq=driver.find_elements_by_accessibility_id('æåå')3360 if len(pyq) != 0:3361 print('å享å°æååæé®åå¨ï¼æ£æ¥éè¿')3362 sleep(1)3363 driver.find_element_by_accessibility_id('æåå').click()3364 sleep(8)3365 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')3366 word2.click()3367 sleep(1)3368 now2=time.strftime('%Y-%m-%d %H_%M_%S')3369 word2.send_keys('æç¨Python_Giftæåå:'+now2)3370 sleep(1)3371 driver.find_element_by_accessibility_id('表æ
').click()3372 sleep(1)3373 driver.find_element_by_accessibility_id('å®æ').click()3374 sleep(2)3375 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()3376 sleep(1)3377 #ç§å¯, ä»
èªå·±å¯è§3378 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()3379 sleep(1)3380 driver.find_element_by_accessibility_id('å®æ').click()3381 sleep(2)3382 #å表3383 driver.find_element_by_accessibility_id('å表').click()3384 sleep(1)3385 #æ£æ¥toast3386 save2=driver.find_elements_by_accessibility_id('å享æå')3387 if len(save2) != 0:3388 print('å享æååæå')3389 sleep(1)3390 else:3391 print('å享æåå失败ï¼è¯·æ£æ¥åå ')3392 sleep(1)3393 now=time.strftime('%Y-%m-%d %H_%M_%S')3394 sf2='../../test_report/ios/'+now+'_errorGiftsharewechatpyq_R_stg_tc041.png'3395 driver.get_screenshot_as_file(sf2)3396 sleep(1)3397 else:3398 print('å享å°æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3399 sleep(2)3400 #share3401 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':338, 'y':58})3402 sleep(2)3403 #å¾®å3404 wb=driver.find_elements_by_accessibility_id('å¾®å')3405 if len(wb) != 0:3406 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')3407 sleep(2)3408 driver.find_element_by_accessibility_id('å¾®å').click()3409 sleep(8)3410 driver.find_element_by_accessibility_id('åéå°åç»').click()3411 sleep(2)3412 #ä»
èªå·±å¯è§3413 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()3414 sleep(2)3415 #åé3416 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()3417 sleep(1)3418 #æ£æ¥toast3419 save3=driver.find_elements_by_accessibility_id('å享æå')3420 if len(save3) != 0:3421 print('å享微åæå')3422 sleep(1)3423 else:3424 print('å享微å失败ï¼è¯·æ£æ¥åå ')3425 sleep(1)3426 now=time.strftime('%Y-%m-%d %H_%M_%S')3427 sf3='../../test_report/ios/'+now+'_errorGiftsharewebo_R_stg_tc041.png'3428 driver.get_screenshot_as_file(sf3)3429 sleep(1)3430 else:3431 print('å享å°æ°æµªå¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3432 sleep(2)3433 #share3434 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':338, 'y':58})3435 sleep(2)3436 #æçæå3437 mf=driver.find_elements_by_accessibility_id('æçæå')3438 if len(mf) != 0:3439 print('å享å°æçæåæé®åå¨ï¼æ£æ¥éè¿')3440 sleep(1)3441 driver.find_element_by_accessibility_id('æçæå').click()3442 sleep(2)3443 driver.find_element_by_accessibility_id('æå').click()3444 sleep(2)3445 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam")]')[0].click()3446 sleep(1)3447 #æ£æ¥toast3448 save4=driver.find_elements_by_accessibility_id('å享æå')3449 if len(save4) != 0:3450 print('å享æçæåæå')3451 sleep(1)3452 else:3453 print('å享æçæå失败ï¼è¯·æ£æ¥åå ')3454 sleep(1)3455 now=time.strftime('%Y-%m-%d %H_%M_%S')3456 sf4='../../test_report/ios/'+now+'_errorGiftsharemyfriend_R_stg_tc041.png'3457 driver.get_screenshot_as_file(sf4)3458 sleep(1)3459 else:3460 print('å享å°æçæåæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3461 sleep(2)3462 else:3463 print('å享æé®ä¸åå¨/æªæ¾å°ï¼è¯·æ£æ¥åå ')3464 sleep(2)3465 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':24, 'y':58})3466 sleep(2)3467 else:3468 print('éè¦å
æ¢çååä¸åå¨/æªæ¾å°ï¼è¯·æ£æ¥åå ')3469 sleep(2)3470 now=time.strftime('%Y-%m-%d %H_%M_%S')3471 print('TC_æå_æå页é¢çååçå享åè½----ç»æ:'+now)3472#*******************************************************3473#TC Name:test_jingxi_visitor_tc0423474#Purpose:æ£æ¥è®¿å®¢æ¨¡å¼ç¹å»æç页é¢å个èåçé¢æå¨ä½3475#OS:android3476#Device:iPhone73477#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½3478#Post-conditions:N/A3479#Modify History:created by Sam [2018/10/10]3480#*******************************************************3481 def test_jingxi_visitor_tc042(self):3482 driver=self.driver3483 print('TC_访客模å¼ç¹å»æç页é¢å个èåï¼æ£æ¥ç¹:æå_æå页é¢çåå详ç»é¡µé¢ç访客模å¼æ£æ¥----step1æ£æ¥ç¨æ·æ¯å¦å·²ç»ç»å½')3484 print('step2å¦æç¨æ·å·²ç»ç»å½åéåºåæ¥è´¦å·ï¼step3éæ©ä¸æ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢ï¼step4ä»excelæ件读åè¦æ£æ¥çå个èåå称ï¼')3485 print('ä¾æ¬¡ç¹å»æ£æ¥æ¯å¦ä¼è·³è½¬å°ç¨æ·ç»å½çé¢')3486 now=time.strftime('%Y-%m-%d %H_%M_%S')3487 print('æå_æå页é¢çåå详ç»é¡µé¢ç访客模å¼æ£æ¥----å¼å§:'+now)3488 sleep(1)3489 driver.find_element_by_accessibility_id('è¿å').click()3490 sleep(1)3491 g=bp_is_loggedin(self)3492 sleep(2)3493 #æå3494 driver.find_element_by_accessibility_id('æå').click()3495 sleep(8)3496 for i in range(1):3497 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':350,'duration':1.0})3498 sleep(2)3499 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':350,'duration':1.0})3500 sleep(2)3501 u=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]')3502 if len(u) != 0:3503 print('éè¦å
æ¢çåååå¨ï¼æ£æ¥éè¿')3504 sleep(2)3505 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]').click()3506 sleep(8)3507 page=driver.page_source3508 sleep(2)3509 f=fun_getjingxiloginmenu(self)3510 sleep(2)3511 #check the menu by turn3512 for j in range(0,2):3513 driver.find_element_by_xpath(f[0][j]).click()3514 sleep(2)3515 print('æ£æ¥çå
ç´ å称ï¼'+f[1][j])3516 sleep(1)3517 bp_is_loginshow(self)3518 sleep(2)3519 driver.find_element_by_accessibility_id('all page back black icon').click()3520 sleep(2)3521 #æºå¨äººå¾æ 3522 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':32, 'y':632})3523 sleep(2)3524 bp_is_loginshow(self)3525 sleep(2)3526 driver.find_element_by_accessibility_id('all page back black icon').click()3527 sleep(2)3528 #è´ç©è½¦å¾æ 3529 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':76, 'y':632})3530 sleep(2)3531 bp_is_loginshow(self)3532 sleep(2)3533 driver.find_element_by_accessibility_id('all page back black icon').click()3534 sleep(2)3535 #driver.find_element_by_xpath('//XCUIElementTypeOther[@name="横å¹
"]/XCUIElementTypeOther[1]').click()3536 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3537 sleep(2)3538 driver.find_element_by_accessibility_id('æç').click()3539 sleep(3)3540 bp_normalloginmp(self)3541 sleep(2)3542 else:3543 print('éè¦å
æ¢çååä¸åå¨/æªæ¾å°ï¼è¯·éæ°æé')3544 sleep(2)3545 now=time.strftime('%Y-%m-%d %H_%M_%S')3546 print('TC_æå_æå页é¢çåå详ç»é¡µé¢ç访客模å¼æ£æ¥----ç»æ:'+now)3547#************************************************************************************************************3548#TC Name:test_jingxi_cartcheck_tc0433549#Purpose:æ£æ¥ç¨æ·æ¨¡å¼éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åè´ç©è½¦å¾æ è§æ çååæ£æ¥3550#OS:android3551#Device:iPhone73552#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½3553#Post-conditions:N/A3554#Modify History:created by Sam [2018/10/10]3555#************************************************************************************************************3556 def test_jingxi_cartcheck_tc043(self):3557 driver=self.driver3558 print('TC_ç¨æ·æ¨¡å¼è¿å
¥æå页é¢ï¼æ£æ¥ç¹:æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åè´ç©è½¦å¾æ è§æ çåå----step1ç¨æ·æ¨¡å¼è¿å
¥æå页é¢')3559 print('step2éæ©ä¸æ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢ï¼step3ç¹å»å å
¥è´ç©è½¦æé®æ£æ¥è´ç©è½¦å¾æ è§æ æ°åæ¯å¦ä¸º1')3560 print('step4ç¹å»è´ç©è½¦å¾æ è¿å
¥è´ç©è½¦è¯¦ç»é¡µé¢ï¼æ£æ¥å·¦ä¸è§æ¯å¦æ¾ç¤ºå·²é(1)')3561 print('step5éæ©ç¬¬äºæ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢;step6ç¹å»å å
¥è´ç©è½¦æé®æ£æ¥è´ç©è½¦å¾æ è§æ æ°åæ¯å¦ä¸º2')3562 print('step7ç¹å»è´ç©è½¦å¾æ è¿å
¥è´ç©è½¦è¯¦ç»é¡µé¢ï¼æ£æ¥å·¦ä¸è§æ¯å¦æ¾ç¤ºå·²é(2)')3563 now=time.strftime('%Y-%m-%d %H_%M_%S')3564 print('æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åè´ç©è½¦å¾æ è§æ çååæ£æ¥----å¼å§:'+now)3565 sleep(1)3566 driver.find_element_by_accessibility_id('è¿å').click()3567 sleep(1)3568 #æå3569 driver.find_element_by_accessibility_id('æå').click()3570 sleep(8)3571 for i in range(1):3572 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':350,'duration':1.0})3573 sleep(2)3574 #driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':350,'duration':1.0})3575 sleep(2)3576 u1=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]')3577 if len(u1) != 0:3578 print('éè¦å
æ¢çåå1åå¨ï¼æ£æ¥éè¿')3579 sleep(2)3580 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]').click()3581 sleep(6)3582 #page=driver.page_source3583 #sleep(2)3584 add2b=driver.find_elements_by_accessibility_id('å å
¥è´ç©è½¦')3585 sleep(2)3586 if len(add2b) != 0:3587 print('å å
¥è´ç©è½¦æé®åå¨ï¼æ£æ¥éè¿')3588 sleep(2)3589 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3590 sleep(3)3591 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3592 sleep(3)3593 #è´ç©è½¦è§æ 3594 ch1=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="1"]')3595 if len(ch1) != 0:3596 print('è´ç©è½¦å¾æ è§æ æ°å为1æ£æ¥æå')3597 sleep(2)3598 #ç¹å»è´ç©è½¦å¾æ 3599 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="1"]').click()3600 sleep(4)3601 ch1a=driver.find_elements_by_xpath('//XCUIElementTypeOther[contains(@name,"å·²é(1)")]')3602 if len(ch1a) != 0:3603 print('è´ç©è½¦è¯¦ç»é¡µé¢å·¦ä¸è§æ¾ç¤ºå·²é(1)æ£æ¥éè¿')3604 sleep(1)3605 else:3606 print('è´ç©è½¦è¯¦ç»é¡µé¢å·¦ä¸è§æ¾ç¤ºå·²é(1)æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3607 sleep(1)3608 now=time.strftime('%Y-%m-%d %H_%M_%S')3609 sf1a='../../test_report/ios/'+now+'_errorCartGift1a_R_tc043.png'3610 driver.get_screenshot_as_file(sf1a)3611 sleep(2)3612 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':37, 'y':42})3613 sleep(2)3614 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3615 sleep(2)3616 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3617 sleep(2)3618 u2=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç¾å©çæ
人èç³ 21 Cake · ç¾å©çæ
人èç³ 5"]')3619 if len(u2) != 0:3620 print('éè¦å
æ¢çåå2åå¨ï¼æ£æ¥éè¿')3621 sleep(2)3622 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="ç¾å©çæ
人èç³ 21 Cake · ç¾å©çæ
人èç³ 5"]').click()3623 sleep(8)3624 #page=driver.page_source3625 #sleep(2)3626 #add2b=driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦')3627 #sleep(2)3628 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3629 sleep(3)3630 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3631 sleep(5)3632 #è´ç©è½¦è§æ 3633 ch1=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="2"]')3634 if len(ch1) != 0:3635 print('è´ç©è½¦å¾æ è§æ æ°å为2æ£æ¥æå')3636 sleep(2)3637 #ç¹å»è´ç©è½¦å¾æ 3638 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="2"]').click()3639 sleep(4)3640 ch2a=driver.find_elements_by_xpath('//XCUIElementTypeOther[contains(@name,"å·²é(2)")]')3641 if len(ch2a) != 0:3642 print('è´ç©è½¦è¯¦ç»é¡µé¢å·¦ä¸è§æ¾ç¤ºå·²é(2)æ£æ¥éè¿')3643 sleep(1)3644 else:3645 print('è´ç©è½¦è¯¦ç»é¡µé¢å·¦ä¸è§æ¾ç¤ºå·²é(2)æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3646 sleep(1)3647 now=time.strftime('%Y-%m-%d %H_%M_%S')3648 sf2a='../../test_report/ios/'+now+'_errorCartGift2a_R_stg_tc043.png'3649 driver.get_screenshot_as_file(sf2a)3650 sleep(2)3651 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':37, 'y':42})3652 sleep(2)3653 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3654 sleep(2)3655 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3656 sleep(2)3657 else:3658 print('è´ç©è½¦å¾æ è§æ æ°å为2æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3659 now=time.strftime('%Y-%m-%d %H_%M_%S')3660 sf2='../../test_report/ios/'+now+'_errorCartGift2_R_stg_tc043.png'3661 driver.get_screenshot_as_file(sf2)3662 sleep(2)3663 else:3664 print('éè¦å
æ¢çåå2ä¸åå¨/æªæ¾å°ï¼è¯·éæ°æé')3665 sleep(2)3666 else:3667 print('è´ç©è½¦å¾æ è§æ æ°å为1æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3668 sleep(1)3669 now=time.strftime('%Y-%m-%d %H_%M_%S')3670 sf1='../../test_report/ios/'+now+'_errorCartGift1_R_stg_tc043.png'3671 driver.get_screenshot_as_file(sf1)3672 sleep(2)3673 else:3674 print('å å
¥è´ç©è½¦æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3675 sleep(2)3676 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3677 sleep(2)3678 else:3679 print('éè¦å
æ¢çåå1ä¸åå¨/æªæ¾å°ï¼è¯·éæ°æé')3680 sleep(2)3681 now=time.strftime('%Y-%m-%d %H_%M_%S')3682 print('TC_æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åè´ç©è½¦å¾æ è§æ çååæ£æ¥----ç»æ:'+now)3683#*******************************************************3684#TC Name:test_jingxi_clearcart_tc0443685#Purpose:æ£æ¥ç¨æ·æ¨¡å¼æåéæ©å¤æ¬¾ååå å
¥è´ç©è½¦åæ¸
空è´ç©è½¦çåè½æ£æ¥3686#OS:android3687#Device:iPhone73688#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½3689#Post-conditions:N/A3690#Modify History:created by Sam [2018/10/10]3691#*******************************************************3692 def test_jingxi_clearcart_tc044(self):3693 driver=self.driver3694 print('TC_ç¨æ·æ¨¡å¼è¿å
¥æå页é¢ï¼æ£æ¥ç¹:æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åæ¸
空è´ç©è½¦çåè½æ£æ¥----step1ç¨æ·æ¨¡å¼è¿å
¥æå页é¢')3695 print('step2éæ©ä¸æ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢ç¹å»å å
¥è´ç©è½¦æé®')3696 print('step3éæ©ç¬¬äºæ¬¾ååç¹å»è¿å
¥åå详ç»é¡µé¢ç¹å»å å
¥è´ç©è½¦æé®')3697 print('step4ç¹å»è´ç©è½¦å¾æ è¿å
¥è´ç©è½¦è¯¦ç»é¡µé¢ï¼ç¹å»ç¼è¾ï¼ç¹å»å
¨éï¼åç¹å»å é¤æéï¼ç¡®å®')3698 print('step5æ£æ¥æ¤æ¶è´ç©è½¦æ¯å¦æ²¡æä»»ä½åå')3699 now=time.strftime('%Y-%m-%d %H_%M_%S')3700 print('æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åæ¸
空è´ç©è½¦çåè½æ£æ¥----å¼å§:'+now)3701 sleep(1)3702 driver.find_element_by_accessibility_id('è¿å').click()3703 sleep(1)3704 #æå3705 driver.find_element_by_accessibility_id('æå').click()3706 sleep(6)3707 for i in range(4):3708 driver.execute_script("mobile: scroll", {"direction": "down"})3709 sleep(1)3710 sleep(2)3711 u1=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]')3712 if len(u1) != 0:3713 print('éè¦å
æ¢çåå1åå¨ï¼æ£æ¥éè¿')3714 sleep(2)3715 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="çç®iPhoneææºå£³ çç®iPhoneææºå£³ 1"]').click()3716 sleep(6)3717 #page=driver.page_source3718 #sleep(2)3719 add2b=driver.find_elements_by_accessibility_id('å å
¥è´ç©è½¦')3720 sleep(2)3721 if len(add2b) != 0:3722 print('å å
¥è´ç©è½¦æé®åå¨ï¼æ£æ¥éè¿')3723 sleep(2)3724 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3725 sleep(3)3726 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3727 sleep(3)3728 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3729 sleep(2)3730 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3731 sleep(2)3732 u2=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç¾å©çæ
人èç³ 21 Cake · ç¾å©çæ
人èç³ 5"]')3733 if len(u2) != 0:3734 print('éè¦å
æ¢çåå2åå¨ï¼æ£æ¥éè¿')3735 sleep(2)3736 driver.find_element_by_xpath('//XCUIElementTypeOther[@name="ç¾å©çæ
人èç³ 21 Cake · ç¾å©çæ
人èç³ 5"]').click()3737 sleep(6)3738 #page=driver.page_source3739 #sleep(2)3740 #add2b=driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦')3741 #sleep(2)3742 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3743 sleep(3)3744 driver.find_element_by_accessibility_id('å å
¥è´ç©è½¦').click()3745 sleep(3)3746 #ç¹å»è´ç©è½¦å¾æ 3747 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="2"]').click()3748 sleep(4)3749 ch2a=driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç¼è¾"]')3750 if len(ch2a) != 0:3751 print('ç¼è¾æé®åå¨ï¼æ£æ¥éè¿')3752 sleep(2)3753 driver.find_elements_by_xpath('//XCUIElementTypeOther[@name="ç¼è¾"]')[4].click()3754 sleep(2)3755 #driver.find_element_by_xpath('//XCUIElementTypeOther[contains(@name,"å
¨é")]').click()3756 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':28, 'y':630})3757 sleep(2)3758 #å é¤æé3759 driver.find_element_by_accessibility_id('å é¤æé').click()3760 sleep(1)3761 driver.find_element_by_accessibility_id('ç¡®å®').click()3762 sleep(3)3763 chk0=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"å»æ·»å ç¹ä»ä¹å§")]')3764 sleep(2)3765 if len(chk0) != 0:3766 print('è´ç©è½¦å·²æ¸
空')3767 sleep(1)3768 else:3769 print('è´ç©è½¦æªè¢«æ¸
空ï¼è¯·æ£æ¥åå ')3770 sleep(1)3771 now=time.strftime('%Y-%m-%d %H_%M_%S')3772 sf3='../../test_report/ios/'+now+'_errorCartNoEdit_R_stg_tc044.png'3773 driver.get_screenshot_as_file(sf3)3774 sleep(2)3775 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':37, 'y':42})3776 sleep(2)3777 else:3778 print('ç¼è¾æé®ä¸åå¨ï¼æ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3779 sleep(1)3780 now=time.strftime('%Y-%m-%d %H_%M_%S')3781 sf2a='../../test_report/ios/'+now+'_errorCartNoEdit_R_stg_tc044.png'3782 driver.get_screenshot_as_file(sf2a)3783 sleep(2)3784 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':37, 'y':42})3785 sleep(2)3786 else:3787 print('éè¦å
æ¢çåå2ä¸åå¨/æªæ¾å°ï¼è¯·éæ°æé')3788 sleep(2)3789 else:3790 print('å å
¥è´ç©è½¦æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3791 sleep(2)3792 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':34, 'y':58})3793 sleep(2)3794 else:3795 print('éè¦å
æ¢çåå1ä¸åå¨/æªæ¾å°ï¼è¯·éæ°æé')3796 sleep(2)3797 now=time.strftime('%Y-%m-%d %H_%M_%S')3798 print('TC_æå_éæ©å¤æ¬¾ååå å
¥è´ç©è½¦åæ¸
空è´ç©è½¦çåè½æ£æ¥----ç»æ:'+now)3799#*******************************************************3800#TC Name:test_wode_activityshow_tc0463801#Purpose:æ£æ¥ç¨æ·æ¨¡å¼ç¹å»æç页é¢å个èåçé¢æå¨ä½3802#OS:android3803#Device:iPhone73804#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app/æªç»å½3805#Post-conditions:N/A3806#Modify History:created by Sam [2018/10/15]3807#*******************************************************3808 def test_wode_activityshow_tc046(self):3809 driver=self.driver3810 print('TC_ç¨æ·æ¨¡å¼ç¹å»æçæçæ´»å¨èåï¼æ£æ¥ç¹:æç_æçæ´»å¨æå¾åè½æ£æ¥----')3811 print('step1è¿å
¥æçæ´»å¨é¡µé¢ï¼step2æ£æ¥æ¯å¦ææå¾æé®ï¼step3æ£æ¥æå¾åè½æ¯å¦æ£å¸¸')3812 print('step4æ£æ¥æå¾çæåæ¯å¦æ£ç¡®;step5æ£æ¥æå¾ç9å¼ å¾çæ°éæ¯å¦æ£ç¡®')3813 now=time.strftime('%Y-%m-%d %H_%M_%S')3814 print('TC_æç_æçæ´»å¨æå¾åæ£æ¥----å¼å§:'+now)3815 sleep(2)3816 driver.find_element_by_accessibility_id('è¿å').click()3817 sleep(2)3818 #æç3819 driver.find_element_by_accessibility_id('æç').click()3820 sleep(4)3821 driver.find_element_by_accessibility_id('æçæ´»å¨').click()3822 sleep(3)3823 u=driver.find_elements_by_accessibility_id('æå¾')3824 if len(u) != 0:3825 print('æå¾æé®åå¨ï¼æ£æ¥éè¿')3826 sleep(2)3827 driver.find_element_by_accessibility_id('æå¾').click()3828 sleep(2)3829 #+3830 driver.execute_script("mobile: tap", {"touchCount":"1", "x":55, "y":264})3831 sleep(2)3832 #好3833 allow=driver.find_elements_by_accessibility_id('好')3834 if len(allow) != 0:3835 driver.find_element_by_accessibility_id('好').click()3836 sleep(2)3837 sleep(1)3838 try:3839 for i in range(9):3840 #driver.find_elements_by_xpath('//XCUIElementTypeButton[@name="compose guide check box defaul"]')[i].click()3841 driver.find_elements_by_ios_predicate('name=="compose guide check box defaul"')[i].click()3842 sleep(1)3843 sleep(1)3844 driver.find_element_by_accessibility_id('å®æ(9/9)').click()3845 sleep(2)3846 word=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextView')3847 sleep(2)3848 word.click()3849 sleep(1)3850 now0=time.strftime('%Y-%m-%d %H_%M_%S')3851 word.send_keys('æç¨Python_æå¾'+now0)3852 t0='æç¨Python_æå¾_'+now03853 sleep(1)3854 driver.find_element_by_accessibility_id('åå¸').click()3855 sleep(9)3856 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':550,'toX':50,'toY':50,'duration':1.0})3857 sleep(2)3858 #check numbers of pictures and published text here3859 title=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,t0)]')3860 sleep(2)3861 if len(title) != 0 :3862 print('æå¾çæåæ£æ¥éè¿')3863 sleep(1)3864 else:3865 print('æå¾çæåæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3866 sleep(1)3867 now=time.strftime('%Y-%m-%d %H_%M_%S')3868 sf1='../../test_report/ios/'+now+'_errorPublishText_R_tc046.png'3869 driver.get_screenshot_as_file(sf1)3870 sleep(2)3871 number=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="9"]')3872 if len(number) != 0:3873 print('æå¾çä¸ä¼ 9å¼ å¾çæ£æ¥éè¿')3874 sleep(1)3875 else:3876 print('æå¾çä¸ä¼ 9å¼ å¾çæ£æ¥å¤±è´¥ï¼è¯·æ£æ¥åå ')3877 sleep(1)3878 now=time.strftime('%Y-%m-%d %H_%M_%S')3879 sf2='../../test_report/ios/'+now+'_errorPublishPicture9_R_tc046.png'3880 driver.get_screenshot_as_file(sf2)3881 sleep(2)3882 driver.find_element_by_accessibility_id('all page back black icon').click()3883 sleep(2)3884 except Exception as e:3885 print('åçå¼å¸¸ï¼'+str(e))3886 sleep(2)3887 pass3888 else:3889 print('æå¾æé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3890 sleep(2)3891 driver.find_element_by_accessibility_id('all page back black icon').click()3892 sleep(2)3893 now=time.strftime('%Y-%m-%d %H_%M_%S')3894 print('TC_æç_æçæ´»å¨æå¾åæ£æ¥----ç»æ:'+now)3895#*******************************************************3896#TC Name:test_wode_es8ordershare_tc0473897#Purpose:æ£æ¥æçES8订åçå享åè½3898#OS:iOS3899#Device:iPhone73900#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app3901#Post-conditions:N/A3902#Modify History:created by Sam [2018/10/25]3903#*******************************************************3904 def test_wode_es8ordershare_tc047(self):3905 driver=self.driver3906 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æç_æçES8订åçå享åè½----step1è¿å
¥æç页é¢')3907 print('step2è¿å
¥æçes8订åç¹å»è¿å
¥è®¢å详ç»é¡µé¢ï¼step3ç¹å³ä¸è§çå享æé®ï¼å
æ£æ¥æ¯å¦åå¨ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')3908 print('step5æ£æ¥å享æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享æ°æµªå¾®ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享NIO好ååè½æ¯å¦æ£å¸¸')3909 now=time.strftime('%Y-%m-%d %H_%M_%S')3910 print('TC_æç_æçES8订åçå享åè½----å¼å§:'+now)3911 sleep(2)3912 driver.find_element_by_accessibility_id('è¿å').click()3913 sleep(2)3914 #æç3915 driver.find_element_by_accessibility_id('æç').click()3916 sleep(4)3917 driver.find_element_by_accessibility_id('æç车è¾è®¢å').click()3918 sleep(8)3919 car=driver.find_elements_by_accessibility_id('ES8åºåç')3920 if len(car) != 0:3921 driver.find_element_by_accessibility_id('ES8åºåç').click()3922 sleep(4)3923 #å享å¾æ 3924 share=driver.find_elements_by_accessibility_id('navigationbar btn share')3925 sleep(2)3926 if len(share) != 0:3927 print('å享æé®åå¨,æ£æ¥éè¿')3928 sleep(3)3929 #share3930 driver.find_element_by_accessibility_id('navigationbar btn share').click()3931 sleep(2)3932 #微信好å3933 wh=driver.find_elements_by_accessibility_id('微信好å')3934 if len(wh) != 0:3935 print('å享å°å¾®ä¿¡å¥½åæé®åå¨ï¼æ£æ¥éè¿')3936 sleep(2)3937 driver.find_element_by_accessibility_id('微信好å').click()3938 sleep(6)3939 driver.find_element_by_accessibility_id('çå°é¾').click()3940 sleep(3)3941 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')3942 sleep(2)3943 if len(words) != 0:3944 words[0].click()3945 sleep(1)3946 now0=time.strftime('%Y-%m-%d %H_%M_%S')3947 words[0].send_keys('人çè¦çæçES8订å微信好å:'+now0)3948 sleep(1)3949 #åé3950 driver.find_element_by_accessibility_id('åé').click()3951 sleep(2)3952 driver.find_element_by_accessibility_id('è¿åèæ¥').click()3953 sleep(1)3954 #æ£æ¥toast3955 save1=driver.find_elements_by_accessibility_id('å享æå')3956 if len(save1) != 0:3957 print('å享微信好åæå')3958 sleep(1)3959 else:3960 print('å享微信好å失败ï¼è¯·æ£æ¥åå ')3961 sleep(1)3962 now=time.strftime('%Y-%m-%d %H_%M_%S')3963 sf1='../../test_report/ios/'+now+'_errorGiftsharewechat_R_tc047.png'3964 driver.get_screenshot_as_file(sf1)3965 sleep(2)3966 else:3967 print('å享å°å¾®ä¿¡å¥½åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')3968 sleep(2)3969 #share3970 driver.find_element_by_accessibility_id('navigationbar btn share').click()3971 sleep(2)3972 #微信æåå3973 pyq=driver.find_elements_by_accessibility_id('微信æåå')3974 if len(pyq) != 0:3975 print('å享å°å¾®ä¿¡æååæé®åå¨ï¼æ£æ¥éè¿')3976 sleep(1)3977 driver.find_element_by_accessibility_id('微信æåå').click()3978 sleep(8)3979 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')3980 word2.click()3981 sleep(1)3982 now2=time.strftime('%Y-%m-%d %H_%M_%S')3983 word2.send_keys('人çè¦çæçES8订å微信æåå:'+now2)3984 sleep(1)3985 driver.find_element_by_accessibility_id('表æ
').click()3986 sleep(1)3987 driver.find_element_by_accessibility_id('å®æ').click()3988 sleep(2)3989 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()3990 sleep(1)3991 #ç§å¯, ä»
èªå·±å¯è§3992 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()3993 sleep(1)3994 driver.find_element_by_accessibility_id('å®æ').click()3995 sleep(2)3996 #å表3997 driver.find_element_by_accessibility_id('å表').click()3998 sleep(1)3999 #æ£æ¥toast4000 save2=driver.find_elements_by_accessibility_id('å享æå')4001 if len(save2) != 0:4002 print('å享微信æååæå')4003 sleep(1)4004 else:4005 print('å享微信æåå失败ï¼è¯·æ£æ¥åå ')4006 sleep(1)4007 now=time.strftime('%Y-%m-%d %H_%M_%S')4008 sf2='../../test_report/ios/'+now+'_errorGiftsharewechatpyq_R_tc047.png'4009 driver.get_screenshot_as_file(sf2)4010 sleep(1)4011 else:4012 print('å享å°å¾®ä¿¡æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4013 sleep(2)4014 """4015 #share4016 driver.find_element_by_accessibility_id('navigationbar btn share').click()4017 sleep(2)4018 #å¾®åno such menu now4019 wb=driver.find_elements_by_accessibility_id('å¾®å')4020 if len(wb) != 0:4021 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')4022 sleep(2)4023 driver.find_element_by_accessibility_id('å¾®å').click()4024 sleep(8)4025 driver.find_element_by_accessibility_id('åéå°åç»').click()4026 sleep(2)4027 #ä»
èªå·±å¯è§4028 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()4029 sleep(2)4030 #åé4031 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()4032 sleep(1)4033 #æ£æ¥toast4034 save3=driver.find_elements_by_accessibility_id('å享æå')4035 if len(save3) != 0:4036 print('å享微åæå')4037 sleep(1)4038 else:4039 print('å享微å失败ï¼è¯·æ£æ¥åå ')4040 sleep(1)4041 now=time.strftime('%Y-%m-%d %H_%M_%S')4042 sf3='../../test_report/ios/'+now+'_errorGiftsharewebo_R_tc047.png'4043 driver.get_screenshot_as_file(sf3)4044 sleep(1)4045 else:4046 print('å享å°æ°æµªå¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4047 sleep(2)4048 """4049 #share4050 driver.find_element_by_accessibility_id('navigationbar btn share').click()4051 sleep(2)4052 #NIO好å4053 mf=driver.find_elements_by_xpath('//XCUIElementTypeStaticText[@name="NIO好å"]')4054 if len(mf) != 0:4055 print('å享å°NIO好åæé®åå¨ï¼æ£æ¥éè¿')4056 sleep(2)4057 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="NIO好å"]').click()4058 sleep(2)4059 driver.find_element_by_accessibility_id('æå').click()4060 sleep(1)4061 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam8")]')[0].click()4062 sleep(1)4063 #æ£æ¥toast4064 save4=driver.find_elements_by_accessibility_id('å享æå')4065 if len(save4) != 0:4066 print('å享NIO好åæå')4067 sleep(1)4068 else:4069 print('å享NIO好å失败ï¼è¯·æ£æ¥åå ')4070 sleep(1)4071 now=time.strftime('%Y-%m-%d %H_%M_%S')4072 sf4='../../test_report/ios/'+now+'_errorGiftsharemyfriend_R_tc047.png'4073 driver.get_screenshot_as_file(sf4)4074 sleep(1)4075 else:4076 print('å享å°NIO好åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4077 sleep(2)4078 else:4079 print('å享æé®ä¸åå¨/æªæ¾å°ï¼è¯·æ£æ¥åå ')4080 sleep(2)4081 #driver.execute_script('mobile: tap', {'touchCount':'1', 'x':24, 'y':58})4082 driver.find_element_by_accessibility_id('navigationbar btn back black1').click() 4083 sleep(2)4084 else:4085 print('ææ 订åï¼æ æ³æ§è¡è¯¥èæ¬')4086 sleep(2)4087 driver.find_element_by_accessibility_id('navigationbar btn back black1').click() 4088 sleep(2)4089 now=time.strftime('%Y-%m-%d %H_%M_%S')4090 print('TC_æç_æçES8订åçå享åè½----ç»æ:'+now)4091#*******************************************************4092#TC Name:test_wode_joinnio_tc0484093#Purpose:æ£æ¥æç页é¢å å
¥èæ¥åè½4094#OS:iOS4095#Device:iPhone74096#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app4097#Post-conditions:N/A4098#Modify History:created by Sam [2018/10/25]4099#*******************************************************4100 def test_wode_joinnio_tc048(self):4101 driver=self.driver4102 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:æç_æç_å å
¥èæ¥----step1è¿å
¥æç页é¢')4103 print('step2è¿å
¥å å
¥èæ¥é¡µé¢ï¼step3ç¹å»èæ¥æ»é¨ï¼step4ç¹å»è½¯ä»¶å¼å')4104 now=time.strftime('%Y-%m-%d %H_%M_%S')4105 print('TC_æç_å å
¥èæ¥----å¼å§:'+now)4106 sleep(2)4107 driver.find_element_by_accessibility_id('è¿å').click()4108 sleep(2)4109 #æç4110 driver.find_element_by_accessibility_id('æç').click()4111 sleep(3)4112 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':500,'toX':50,'toY':200,'duration':1.0})4113 sleep(2)4114 driver.find_element_by_accessibility_id('å å
¥èæ¥').click()4115 sleep(6)4116 page=driver.page_source4117 sleep(2)4118 #èæ¥æ»é¨4119 driver.execute_script("mobile: tap", {"touchCount":"1", "x":388, "y":249})4120 ###driver.find_element_by_xpath('//XCUIElementTypeOther[@name="NIO"]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeOther[1]').click()4121 sleep(5)4122 #软件å¼å4123 driver.execute_script("mobile: tap", {"touchCount":"1", "x":388, "y":347})4124 ###driver.find_element_by_xpath('//XCUIElementTypeOther[@name="NIO"]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeOther[3]').click()4125 sleep(4)4126 #å
许4127 allow=driver.find_elements_by_accessibility_id('å
许')4128 if len(allow) != 0:4129 driver.find_element_by_accessibility_id('å
许').click()4130 sleep(2)4131 #好4132 allow2=driver.find_elements_by_accessibility_id('好')4133 if len(allow2) != 0:4134 driver.find_element_by_accessibility_id('好').click()4135 sleep(2) 4136 now=time.strftime('%Y-%m-%d %H_%M_%S')4137 sf1='../../test_report/ios/'+now+'_devJobs_R_tc048.png'4138 driver.get_screenshot_as_file(sf1)4139 sleep(3)4140 driver.find_element_by_accessibility_id('è¿å').click()4141 sleep(2)4142 driver.find_element_by_accessibility_id('è¿åâèæ¥Testâ').click()4143 sleep(2)4144 now=time.strftime('%Y-%m-%d %H_%M_%S')4145 print('TC_æç_å å
¥èæ¥----ç»æ:'+now)4146#*******************************************************4147#TC Name:test_aiche_cityplan_tc0494148#Purpose:æ£æ¥ç±è½¦é¡µé¢éæ¥è¯¢ä¸æµ·å¸åå¸æå¡è§å4149#OS:iOS4150#Device:iPhone74151#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app4152#Post-conditions:N/A4153#Modify History:created by Sam [2018/10/25]4154#*******************************************************4155 def test_aiche_cityplan_tc049(self):4156 driver=self.driver4157 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:ç±è½¦_æ¥è¯¢ä¸æµ·å¸åå¸æå¡è§å----step1è¿å
¥ç±è½¦é¡µé¢')4158 print('step2ç¹å»åå¸æå¡æ¥è¯¢é¡µé¢ï¼step3éæ©å±±è¥¿ç->太åå¸;step4æ£æ¥å¤ªåå¸åå¸æå¡è§åæ¯å¦æ¾ç¤ºæ£å¸¸')4159 now=time.strftime('%Y-%m-%d %H_%M_%S')4160 print('TC_ç±è½¦_æ¥è¯¢å¤ªåå¸åå¸æå¡è§å----å¼å§:'+now)4161 sleep(1)4162 driver.find_element_by_accessibility_id('è¿å').click()4163 sleep(1)4164 #ç±è½¦4165 driver.find_element_by_accessibility_id('ç±è½¦').click()4166 sleep(4)4167 #driver.execute_script("mobile: tap", {"touchCount":"1", "x":188, "y":613})4168 #sleep(2)4169 for i in range(5):4170 driver.execute_script("mobile: scroll", {"direction": "down"})4171 sleep(1)4172 sleep(2)4173 city=driver.find_elements_by_accessibility_id('åå¸æå¡æ¥è¯¢')4174 if len(city) != 0:4175 print('åå¸æå¡æ¥è¯¢æé®æ¾å°')4176 sleep(2)4177 driver.find_element_by_accessibility_id('åå¸æå¡æ¥è¯¢').click()4178 sleep(4)4179 driver.find_element_by_accessibility_id('ä¸æµ·å¸').click()4180 sleep(2)4181 driver.find_element_by_accessibility_id('山西ç').click()4182 sleep(2)4183 driver.find_element_by_accessibility_id('太åå¸').click()4184 sleep(4)4185 #代客ä¸ç4186 ch1=driver.find_elements_by_accessibility_id('NIOåå¸æå¡è§å')4187 ch2=driver.find_elements_by_accessibility_id('太åå¸')4188 ch3=driver.find_elements_by_accessibility_id('代客ä¸ç')4189 if len(ch1) != 0 and len(ch2) != 0 and len(ch3) != 0:4190 print('太åå¸åå¸æå¡è§åæ¾ç¤ºæ£å¸¸')4191 sleep(1)4192 else:4193 print('太åå¸åå¸æå¡è§åæ¾ç¤ºä¸æ£å¸¸ï¼è¯·æ£æ¥åå ')4194 sleep(1)4195 now=time.strftime('%Y-%m-%d %H_%M_%S')4196 sf1='../../test_report/ios/'+now+'_errSHcityplan_R_tc049.png'4197 driver.get_screenshot_as_file(sf1)4198 sleep(2)4199 driver.find_element_by_accessibility_id('nav back btn').click()4200 sleep(2)4201 else:4202 print('åå¸æå¡æ¥è¯¢æé®æªæ¾å°/ä¸åå¨ï¼è¯·æ£æ¥åå ')4203 sleep(2)4204 now=time.strftime('%Y-%m-%d %H_%M_%S')4205 print('TC_ç±è½¦_æ¥è¯¢å¤ªåå¸åå¸æå¡è§å----ç»æ:'+now)4206#*******************************************************4207#TC Name:test_aiche_rechargemap_tc0504208#Purpose:æ£æ¥ç±è½¦é¡µé¢éæ¥è¯¢å
çµå°å¾åæ¥çå
çµæ¡©ä¿¡æ¯4209#OS:iOS4210#Device:iPhone74211#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app4212#Post-conditions:N/A4213#Modify History:created by Sam [2018/10/25]4214#*******************************************************4215 def test_aiche_rechargemap_tc050(self):4216 driver=self.driver4217 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:ç±è½¦_å
çµå°å¾åæ¥çå
çµæ¡©ä¿¡æ¯----step1è¿å
¥ç±è½¦é¡µé¢')4218 print('step2ç¹å»å
çµå°å¾ï¼step3ç¹å»ä¸ä¸ªå
çµæ¡©;step4æ£æ¥å
çµæ¡©ä¿¡æ¯æ¯å¦æ¾ç¤ºæ£å¸¸')4219 now=time.strftime('%Y-%m-%d %H_%M_%S')4220 print('TC_ç±è½¦_å
çµå°å¾åæ¥çå
çµæ¡©ä¿¡æ¯----å¼å§:'+now)4221 sleep(1)4222 driver.find_element_by_accessibility_id('è¿å').click()4223 sleep(1)4224 #ç±è½¦4225 driver.find_element_by_accessibility_id('ç±è½¦').click()4226 sleep(4)4227 #driver.execute_script("mobile: tap", {"touchCount":"1", "x":188, "y":613})4228 #sleep(2)4229 for i in range(5):4230 driver.execute_script("mobile: scroll", {"direction": "down"})4231 sleep(1)4232 sleep(2)4233 cmap=driver.find_elements_by_accessibility_id('å
çµå°å¾')4234 if len(cmap) != 0:4235 print('å
çµå°å¾æé®æ¾å°')4236 sleep(2)4237 driver.find_element_by_accessibility_id('å
çµå°å¾').click()4238 sleep(4)4239 page=driver.page_source4240 sleep(2)4241 #driver.find_element_by_id('cn.com.weilaihui3:id/charging_pile_drag_view').click()4242 driver.execute_script("mobile: tap", {"touchCount":"1", "x":268, "y":239})4243 sleep(4)4244 ch1=driver.find_elements_by_accessibility_id('ä¸æµ·æ¹å®æ¯æèå
çµç«')4245 if len(ch1) != 0:4246 print('å
çµæ¡©ä¿¡æ¯æ¾ç¤ºæ£å¸¸')4247 sleep(1)4248 else:4249 print('å
çµæ¡©ä¿¡æ¯æ¾ç¤ºä¸æ£å¸¸ï¼è¯·æ£æ¥åå ')4250 now=time.strftime('%Y-%m-%d %H_%M_%S')4251 sf1='../../test_report/ios/'+now+'_errPileStatus_R_tc050.png'4252 driver.get_screenshot_as_file(sf1)4253 sleep(2)4254 driver.find_element_by_accessibility_id('routPlanBack').click()4255 sleep(2)4256 else:4257 print('å
çµå°å¾æé®æªæ¾å°/ä¸åå¨ï¼è¯·æ£æ¥åå ')4258 sleep(2)4259 now=time.strftime('%Y-%m-%d %H_%M_%S')4260 print('TC_ç±è½¦_å
çµå°å¾åæ¥çå
çµæ¡©ä¿¡æ¯----ç»æ:'+now)4261#*******************************************************4262#TC Name:test_aiche_milecalculator_tc0514263#Purpose:æ£æ¥ç±è½¦é¡µé¢éES8éç¨è®¡ç®å¨4264#OS:iOS4265#Device:iPhone74266#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app4267#Post-conditions:N/A4268#Modify History:created by Sam [2018/10/25]4269#*******************************************************4270 def test_aiche_milecalculator_tc051(self):4271 driver=self.driver4272 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:ç±è½¦_ES8éç¨è®¡ç®å¨----step1è¿å
¥ç±è½¦é¡µé¢')4273 print('step2ç¹å»ES8éç¨è®¡ç®å¨ï¼step3æ¹åè¡é©¶é度;step4æ¹å车å¤æ¸©åº¦;step5æå¼ç©ºè°;step6æ¹åè½®æ¯å°ºå¯¸æ£æ¥éç¨è®¡ç®æ¯å¦æ£ç¡®')4274 now=time.strftime('%Y-%m-%d %H_%M_%S')4275 print('TC_ç±è½¦_ES8éç¨è®¡ç®å¨----å¼å§:'+now)4276 sleep(21)4277 driver.find_element_by_accessibility_id('è¿å').click()4278 sleep(1)4279 #ç±è½¦4280 driver.find_element_by_accessibility_id('ç±è½¦').click()4281 sleep(4)4282 #driver.execute_script("mobile: tap", {"touchCount":"1", "x":188, "y":613})4283 #sleep(2)4284 for i in range(5):4285 driver.execute_script("mobile: scroll", {"direction": "down"})4286 sleep(1)4287 sleep(2)4288 cmap=driver.find_elements_by_accessibility_id('ES8éç¨è®¡ç®å¨')4289 if len(cmap) != 0:4290 print('ES8éç¨è®¡ç®å¨æé®æ¾å°')4291 sleep(2)4292 driver.find_element_by_accessibility_id('ES8éç¨è®¡ç®å¨').click()4293 sleep(4)4294 page=driver.page_source4295 sleep(2)4296 driver.execute_script('mobile: dragFromToForDuration',{'fromX':50,'fromY':530,'toX':50,'toY':503,'duration':1.0})4297 sleep(2)4298 #æ¹åè¡é©¶é度4299 #>4300 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':324, 'y':373})4301 sleep(1)4302 res1=driver.find_elements_by_accessibility_id('393')4303 if len(res1) != 0:4304 print('æ¹åè¡é©¶é度åéç¨è®¡ç®æ£ç¡®')4305 sleep(1)4306 else:4307 print('æ¹åè¡é©¶é度åéç¨è®¡ç®ä¸æ£ç¡®ï¼è¯·æ£æ¥åå ')4308 sleep(1)4309 now=time.strftime('%Y-%m-%d %H_%M_%S')4310 sf1='../../test_report/ios/'+now+'_errMileV_R_tc051.png'4311 driver.get_screenshot_as_file(sf1)4312 sleep(2)4313 #æ¹å车å¤æ¸©åº¦>4314 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':175, 'y':476})4315 sleep(1)4316 driver.execute_script('mobile: tap', {'touchCount':'1', 'x':175, 'y':476})4317 sleep(1)4318 res2=driver.find_elements_by_accessibility_id('387')4319 if len(res2) != 0:4320 print('æ¹å车å¤æ¸©åº¦åéç¨è®¡ç®æ£ç¡®')4321 sleep(1)4322 else:4323 print('æ¹å车å¤æ¸©åº¦åéç¨è®¡ç®ä¸æ£ç¡®ï¼è¯·æ£æ¥åå ')4324 sleep(1)4325 now=time.strftime('%Y-%m-%d %H_%M_%S')4326 sf2='../../test_report/ios/'+now+'_errMileTemp_R_tc051.png'4327 driver.get_screenshot_as_file(sf2)4328 sleep(2)4329 #æå¼ç©ºè°4330 driver.find_element_by_accessibility_id('OFF').click()4331 sleep(1)4332 res3=driver.find_elements_by_accessibility_id('309')4333 if len(res3) != 0:4334 print('æå¼ç©ºè°åéç¨è®¡ç®æ£ç¡®')4335 sleep(1)4336 else:4337 print('æå¼ç©ºè°åéç¨è®¡ç®ä¸æ£ç¡®ï¼è¯·æ£æ¥åå ')4338 sleep(1)4339 now=time.strftime('%Y-%m-%d %H_%M_%S')4340 sf3='../../test_report/ios/'+now+'_errMileAir_R_tc051.png'4341 driver.get_screenshot_as_file(sf3)4342 sleep(2)4343 #æ¹åè½®æ¯å°ºå¯¸4344 driver.find_element_by_accessibility_id('21è±å¯¸').click()4345 sleep(1)4346 res4=driver.find_elements_by_accessibility_id('301')4347 if len(res4) != 0:4348 print('æ¹åè½®æ¯å°ºå¯¸åéç¨è®¡ç®æ£ç¡®')4349 sleep(1)4350 else:4351 print('æ¹åè½®æ¯å°ºå¯¸åéç¨è®¡ç®ä¸æ£ç¡®ï¼è¯·æ£æ¥åå ')4352 sleep(1)4353 now=time.strftime('%Y-%m-%d %H_%M_%S')4354 sf4='../../test_report/ios/'+now+'_errMileDem_R_tc051.png'4355 driver.get_screenshot_as_file(sf4)4356 sleep(2)4357 driver.find_element_by_accessibility_id('nav back btn').click()4358 sleep(2)4359 else:4360 print('ES8éç¨è®¡ç®å¨æé®æªæ¾å°/ä¸åå¨ï¼è¯·æ£æ¥åå ')4361 sleep(2)4362 now=time.strftime('%Y-%m-%d %H_%M_%S')4363 print('TC_ç±è½¦_ES8éç¨è®¡ç®å¨----ç»æ:'+now)4364#*******************************************************4365#TC Name:test_aiche_es8content_tc0524366#Purpose:æ£æ¥ç±è½¦é¡µé¢ES8é
置表æµè§åå享åè½4367#OS:iOS4368#Device:iPhone74369#Pre-conditions:ç¨æ·å·²æ£å¸¸ç»å½app4370#Post-conditions:N/A4371#Modify History:created by Sam [2018/10/25]4372#*******************************************************4373 def test_aiche_es8content_tc052(self):4374 driver=self.driver4375 print('TC_æ£æ¥ææºå·ç ç»å½APPï¼æ£æ¥ç¹:ç±è½¦_ES8é
置表æµè§åå享åè½----step1è¿å
¥ç±è½¦é¡µé¢')4376 print('step2è¿å
¥ES8é
置表ï¼step3ç¹å³ä¸è§çå享æé®ï¼å
æ£æ¥æ¯å¦åå¨)ï¼step4æ£æ¥å享微信好ååè½æ¯å¦æ£å¸¸')4377 print('step5æ£æ¥å享微信æåååè½æ¯å¦æ£å¸¸;step6æ£æ¥å享微å好ååè½æ¯å¦æ£å¸¸;step7æ£æ¥å享NIO好ååè½æ¯å¦æ£å¸¸')4378 now=time.strftime('%Y-%m-%d %H_%M_%S')4379 print('TC_ç±è½¦_ES8é
置表æµè§åå享åè½----å¼å§:'+now)4380 sleep(1)4381 driver.find_element_by_accessibility_id('è¿å').click()4382 sleep(1)4383 #ç±è½¦4384 driver.find_element_by_accessibility_id('ç±è½¦').click()4385 sleep(4)4386 #driver.execute_script("mobile: tap", {"touchCount":"1", "x":188, "y":613})4387 #sleep(2)4388 for i in range(5):4389 driver.execute_script("mobile: scroll", {"direction": "down"})4390 sleep(1)4391 sleep(2)4392 cmap=driver.find_elements_by_accessibility_id('ES8é
置表')4393 if len(cmap) != 0:4394 print('ES8é
置表æé®æ¾å°')4395 sleep(2)4396 #4397 driver.find_element_by_xpath('//XCUIElementTypeTable/XCUIElementTypeCell[8]/XCUIElementTypeButton[6]').click()4398 sleep(6)4399 page=driver.page_source4400 sleep(2)4401 #4402 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="个æ§å"]').click()4403 sleep(3)4404 driver.find_element_by_accessibility_id('éè£
å
').click()4405 sleep(3)4406 driver.find_element_by_accessibility_id('é件').click()4407 sleep(3)4408 #å享å¾æ 4409 share=driver.find_elements_by_accessibility_id('nav share btn')4410 sleep(2)4411 if len(share) != 0:4412 print('å享æé®åå¨,æ£æ¥éè¿')4413 sleep(3)4414 #share4415 driver.find_element_by_accessibility_id('nav share btn').click()4416 sleep(2)4417 #微信好å4418 wh=driver.find_elements_by_accessibility_id('微信好å')4419 if len(wh) != 0:4420 print('å享å°å¾®ä¿¡å¥½åæé®åå¨ï¼æ£æ¥éè¿')4421 sleep(2)4422 driver.find_element_by_accessibility_id('微信好å').click()4423 sleep(6)4424 driver.find_element_by_accessibility_id('çå°é¾').click()4425 sleep(3)4426 words=driver.find_elements_by_xpath('//XCUIElementTypeWindow[4]/XCUIElementTypeImage[1]/XCUIElementTypeOther[5]/XCUIElementTypeTextView')4427 sleep(2)4428 if len(words) != 0:4429 words[0].click()4430 sleep(1)4431 now0=time.strftime('%Y-%m-%d %H_%M_%S')4432 words[0].send_keys('人çè¦çæçES8订å微信好å:'+now0)4433 sleep(1)4434 #åé4435 driver.find_element_by_accessibility_id('åé').click()4436 sleep(2)4437 driver.find_element_by_accessibility_id('è¿åèæ¥').click()4438 sleep(1)4439 #æ£æ¥toast4440 save1=driver.find_elements_by_accessibility_id('å享æå')4441 if len(save1) != 0:4442 print('å享微信好åæå')4443 sleep(1)4444 else:4445 print('å享微信好å失败ï¼è¯·æ£æ¥åå ')4446 sleep(1)4447 now=time.strftime('%Y-%m-%d %H_%M_%S')4448 sf1='../../test_report/ios/'+now+'_errorGiftsharewechat_R_tc052.png'4449 driver.get_screenshot_as_file(sf1)4450 sleep(2)4451 else:4452 print('å享å°å¾®ä¿¡å¥½åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4453 sleep(2)4454 driver.find_element_by_accessibility_id('letter btn close').click()4455 sleep(2)4456 #share4457 driver.find_element_by_accessibility_id('nav share btn').click()4458 sleep(2)4459 #微信æåå4460 pyq=driver.find_elements_by_accessibility_id('微信æåå')4461 if len(pyq) != 0:4462 print('å享å°å¾®ä¿¡æååæé®åå¨ï¼æ£æ¥éè¿')4463 sleep(1)4464 driver.find_element_by_accessibility_id('微信æåå').click()4465 sleep(8)4466 word2=driver.find_element_by_xpath('//XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeOther[1]/XCUIElementTypeTextView')4467 word2.click()4468 sleep(1)4469 now2=time.strftime('%Y-%m-%d %H_%M_%S')4470 word2.send_keys('人çè¦çæçES8订å微信æåå:'+now2)4471 sleep(1)4472 driver.find_element_by_accessibility_id('表æ
').click()4473 sleep(1)4474 driver.find_element_by_accessibility_id('å®æ').click()4475 sleep(2)4476 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="å
¬å¼"]').click()4477 sleep(1)4478 #ç§å¯, ä»
èªå·±å¯è§4479 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ç§å¯"]').click()4480 sleep(1)4481 driver.find_element_by_accessibility_id('å®æ').click()4482 sleep(2)4483 #å表4484 driver.find_element_by_accessibility_id('å表').click()4485 sleep(1)4486 #æ£æ¥toast4487 save2=driver.find_elements_by_accessibility_id('å享æå')4488 if len(save2) != 0:4489 print('å享微信æååæå')4490 sleep(1)4491 else:4492 print('å享微信æåå失败ï¼è¯·æ£æ¥åå ')4493 sleep(1)4494 now=time.strftime('%Y-%m-%d %H_%M_%S')4495 sf2='../../test_report/ios/'+now+'_errorGiftsharewechatpyq_R_tc052.png'4496 driver.get_screenshot_as_file(sf2)4497 sleep(1)4498 else:4499 print('å享å°å¾®ä¿¡æååæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4500 sleep(2)4501 driver.find_element_by_accessibility_id('letter btn close').click()4502 sleep(2)4503 #share4504 driver.find_element_by_accessibility_id('nav share btn').click()4505 sleep(2)4506 #å¾®å4507 wb=driver.find_elements_by_accessibility_id('å¾®å')4508 if len(wb) != 0:4509 print('å享å°å¾®åæé®åå¨ï¼æ£æ¥éè¿')4510 sleep(2)4511 driver.find_element_by_accessibility_id('å¾®å').click()4512 sleep(8)4513 driver.find_element_by_accessibility_id('åéå°åç»').click()4514 sleep(2)4515 #ä»
èªå·±å¯è§4516 driver.find_element_by_xpath('//XCUIElementTypeStaticText[@name="ä»
èªå·±å¯è§"]').click()4517 sleep(2)4518 #åé4519 driver.find_element_by_xpath('//XCUIElementTypeButton[@name="转åå°å¾®å"]').click()4520 sleep(1)4521 #æ£æ¥toast4522 save3=driver.find_elements_by_accessibility_id('å享æå')4523 if len(save3) != 0:4524 print('å享微åæå')4525 sleep(1)4526 else:4527 print('å享微å失败ï¼è¯·æ£æ¥åå ')4528 sleep(1)4529 now=time.strftime('%Y-%m-%d %H_%M_%S')4530 sf3='../../test_report/ios/'+now+'_errorGiftsharewebo_R_tc052.png'4531 driver.get_screenshot_as_file(sf3)4532 sleep(1)4533 else:4534 print('å享å°å¾®åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4535 sleep(2)4536 driver.find_element_by_accessibility_id('letter btn close').click()4537 sleep(2)4538 #share4539 driver.find_element_by_accessibility_id('nav share btn').click()4540 sleep(2)4541 #NIO好å4542 mf=driver.find_elements_by_accessibility_id('NIO好å')4543 if len(mf) != 0:4544 print('å享å°NIO好åæé®åå¨ï¼æ£æ¥éè¿')4545 sleep(1)4546 driver.find_element_by_accessibility_id('NIO好å').click()4547 sleep(2)4548 driver.find_element_by_accessibility_id('æå').click()4549 sleep(2)4550 driver.find_elements_by_xpath('//XCUIElementTypeStaticText[contains(@name,"Sam8")]')[0].click()4551 sleep(1)4552 #æ£æ¥toast4553 save4=driver.find_elements_by_accessibility_id('å享æå')4554 if len(save4) != 0:4555 print('å享NIO好åæå')4556 sleep(1)4557 else:4558 print('å享NIO好å失败ï¼è¯·æ£æ¥åå ')4559 sleep(1)4560 now=time.strftime('%Y-%m-%d %H_%M_%S')4561 sf4='../../test_report/ios/'+now+'_errorGiftsharemyfriend_R_tc052.png'4562 driver.get_screenshot_as_file(sf4)4563 sleep(1)4564 else:4565 print('å享å°NIO好åæé®ä¸åå¨ï¼è¯·æ£æ¥åå ')4566 sleep(2)4567 driver.find_element_by_accessibility_id('letter btn close').click()4568 sleep(2)4569 else:4570 print('å享æé®ä¸åå¨/æªæ¾å°ï¼è¯·æ£æ¥åå ')4571 sleep(2)4572 driver.find_element_by_accessibility_id('nav back btn').click() 4573 sleep(2)4574 now=time.strftime('%Y-%m-%d %H_%M_%S')4575 print('TC_ç±è½¦_ES8é
置表æµè§åå享åè½----ç»æ:'+now)4576 ...
AppPageElement_iOS.py
Source: AppPageElement_iOS.py
1# coding=utf-82import sys3if sys.version_info[:1] > (2,): # python34 xrange = range5class MainPageWidgetIos(object):6 # è´¦æ·è®¾ç½®é¡µ7 def account_setting_page(self):8 d = {}9 # æ é¢10 d["title"] = ["//XCUIElementTypeTable/XCUIElementTypeImage", "xpath", u"è´¦æ·è®¾ç½®é¡µ"]11 # 帮å©ä¸è®¾ç½®12 d["help_setting"] = [u"帮å©ä¸è®¾ç½®", "accessibility_id", u"帮å©ä¸è®¾ç½®"]13 # ç¨æ·å14 d["username"] = ["//XCUIElementTypeTable/XCUIElementTypeStaticText", "xpath", u"ç¨æ·å"]15 return d16 # 帮å©ä¸è®¾ç½®17 def help_setting_page(self):18 d = {}19 # æ é¢20 d["title"] = [u"帮å©ä¸è®¾ç½®", "accessibility_id", u"帮å©ä¸è®¾ç½®"]21 # 帮å©ä¸è®¾ç½®22 d["return"] = ["//XCUIElementTypeOther[2]//XCUIElementTypeButton", "xpath", u"è¿å"]23 # ç»åº24 d["logout"] = [u"éåºç»å½", "accessibility_id", u"éåºç»å½"]25 return d26 # ç»å½é¡µé¢27 def login_page(self):28 d = {}29 # æ é¢30 d["title"] = ["image_login", "accessibility_id", u"ç»å½é¡µé¢"]31 # ç¨æ·å32 d["username"] = ["//XCUIElementTypeOther[3]//XCUIElementTypeTextField", "xpath", u"ç¨æ·åè¾å
¥æ¡"]33 # å¯ç 34 d["password"] = ["//XCUIElementTypeOther[3]//XCUIElementTypeOther[2]/XCUIElementTypeSecureTextField",35 "xpath", u"å¯ç è¾å
¥æ¡"]36 # æ¾ç¤º/å
³éå¯ç 37 d["check_box"] = ["//XCUIElementTypeOther[3]//XCUIElementTypeButton", "xpath", u"æ¾ç¤º/å
³éå¯ç "]38 # ç»å½39 d["login_button"] = ["//XCUIElementTypeOther[3]//XCUIElementTypeScrollView/"40 "XCUIElementTypeOther/XCUIElementTypeButton", "xpath", u"ç»å½æé®"]41 return d42 # APP主页é¢43 def app_home_page(self):44 d = {}45 # æ é¢46 d["title"] = [u"å¾®è", "accessibility_id", u"App主页é¢"]47 # +å·48 d["add_device"] = ["newAdd", "accessibility_id", u"+å·"]49 # è´¦æ·ç®¡ç50 d["account_setting"] = ["newMenu", "accessibility_id", u"è´¦æ·ç®¡ç"]51 # 没æ设å¤/æªç»å½52 d["no_device"] = [u"认è¯å¾®è", "accessibility_id", u"没æ设å¤/æªç»å½"]53 # 设å¤54 device = {}55 for i in xrange(5):56 device[57 i] = "//XCUIElementTypeOther[2]//XCUIElementTypeCell[%s]/XCUIElementTypeStaticText" % (i + 1)58 d["device"] = [device, "xpath", u"å¾
æ§è®¾å¤"]59 # æ设å¤60 d["has_device"] = ["//XCUIElementTypeTable/XCUIElementTypeCell/XCUIElementTypeButton", "xpath", u"æ设å¤"]61 return d62 # æ·»å 设å¤é¡µé¢63 def add_device_method_page(self):64 d = {}65 # æ é¢66 d["title"] = [u"æ·»å 设å¤", "accessibility_id", u"æ·»å 设å¤é¡µé¢"]67 # éè¿è®¾å¤å类添å 68 d["variety"] = ["//XCUIElementTypeOther[2]//XCUIElementTypeButton[4]", "xpath", u"éè¿è®¾å¤å类添å "]69 # æ·»å åå²70 d["history"] = ["//XCUIElementTypeOther[2]//XCUIElementTypeButton[2]", "xpath", u"æ·»å åå²"]71 return d72 # æ·»å 设å¤å类页é¢73 def add_device_list_page(self):74 d = {}75 # æ é¢76 d["title"] = [u"设å¤åç±»", "accessibility_id", u"æ·»å 设å¤å类页é¢"]77 # æ座å表é项78 d["option"] = [u"æ座", "accessibility_id", u"æ座å表é项"]79 return d80 # è¿å
¥è®¾å¤æ·»å åå²é¡µé¢81 # driver.find_elements_by_xpath("//android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.TextView[@text='2']")82 def add_history_list_page(self):83 d = {}84 # æ é¢85 d["title"] = [u"已添å 设å¤", "accessibility_id", u"è¿å
¥è®¾å¤æ·»å åå²é¡µé¢"]86 # å
¬çWi-Fiæºè½è½¬æ¢å¨2代çµé计éç87 d["y201J"] = [u"å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代", "accessibility_id", u"å
¬çWi-Fiæºè½è½¬æ¢å¨2代çµé计éç"]88 # å
¬çWi-Fiæºè½è½¬æ¢å¨2代89 d["y2011"] = [u"å
¬çWi-Fiæºè½æ座2代", "accessibility_id", u"å
¬çWi-Fiæºè½æ座2代"]90 # å
¬çWi-Fiæºè½æ座2代å 强ç91 d["y2011dl"] = [u"å
¬çWi-Fiæºè½æ座2代å 强ç", "accessibility_id", u"å
¬çWi-Fiæºè½æ座2代å 强ç"]92 return d93 # è¿å
¥æ座å表页é¢94 def add_outlet_list_page(self):95 d = {}96 # æ é¢97 d["title"] = [u"æ座", "accessibility_id", u"æ座å表页é¢"]98 # å
¬çWi-Fiæºè½æ座2代99 d["y2011"] = [u"å
¬çWi-Fiæºè½æ座2代", "accessibility_id", u"å
¬çWi-Fiæºè½æ座2代"]100 # å
¬çWi-Fiæºè½è½¬æ¢å¨2代çµé计éç101 d["y201J"] = [u"å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代", "accessibility_id", u"å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代"]102 # å
¬çWi-Fiæºè½æ座2代å 强ç103 d["y2011dl"] = [u"å
¬çWi-Fiæºè½æ座2代å 强ç", "accessibility_id", u"å
¬çWi-Fiæºè½æ座2代å 强ç"]104 return d105 # æ索设å¤é¡µ106 def add_specification_page(self):107 d = {}108 # æ é¢109 d["title"] = [u"æ·»å å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代", "accessibility_id", u"æ索设å¤é¡µ"]110 # ä¸ä¸æ¥111 d["next"] = [u"ä¸ä¸æ¥", "accessibility_id", u"ä¸ä¸æ¥"]112 return d113 # è¿å
¥è¾å
¥å¯ç 页é¢114 def input_wifi_password_page(self):115 d = {}116 # æ é¢117 d["title"] = [u"æ·»å å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代", "accessibility_id", u"æ索设å¤é¡µ"]118 # 确认wifiå¯ç æé®119 d["confirm"] = [u"没æ该å
ç´ ", "accessibility_id", u"确认wifiå¯ç æé®"]120 # wifiå¯ç è¾å
¥æ¡121 d["password"] = [u"没æ该å
ç´ ", "accessibility_id", u"wifiå¯ç è¾å
¥æ¡"]122 # å¯ç æ¾ç¤ºå
³é123 d["check_box"] = [u"没æ该å
ç´ ", "accessibility_id", u"wifiå¯ç è¾å
¥æ¡"]124 # ä¸ä¸æ¥125 d["next"] = [u"ä¸ä¸æ¥", "accessibility_id", u"ä¸ä¸æ¥"]126 return d127 # æ索设å¤çå¾
页é¢128 def search_device_loading_page(self):129 d = {}130 # æ é¢131 d["title"] = [u"æ·»å ä¸", "accessibility_id", u"æ索设å¤çå¾
页é¢"]132 return d133 # æç´¢å°è®¾å¤134 def search_device_success_page(self):135 # æç´¢å°è®¾å¤MAC136 d = {}137 # æ é¢138 d["title"] = [u"æ·»å å
¬çWiFiæºè½çµéç»è®¡ç转æ¢å¨2代", "accessibility_id", u"æ设å¤åºç°"]139 # 设å¤è·¯å¾140 d["device_box"] = [u"没æ该å
ç´ ", "accessibility_id", u"设å¤çå¾
æ·»å "]141 # 使ç¨142 d["confirm"] = [u"å®æ", "accessibility_id", u"使ç¨"]143 return d144 # æ索设å¤è¶
æ¶145 def search_device_fail_page(self):146 d = {}147 # æ é¢148 d["title"] = [u"éè¯", "accessibility_id", u"æ索设å¤è¶
æ¶"]149 return d150 # 设å¤æ§å¶é¡µé¢151 def control_device_page(self):152 d = {}153 # æ é¢154 d["title"] = ["setting", "accessibility_id", u"设å¤æ§å¶é¡µé¢"]155 # 设å¤ä¿¡æ¯è¿å
¥æé®156 d["device_info"] = ["setting", "accessibility_id", u"设å¤ä¿¡æ¯è¿å
¥æé®"]157 # 设å¤ç¦»çº¿æ å¿158 d["offline"] = [u"设å¤ä¸å¨çº¿", "accessibility_id", u"设å¤ç¦»çº¿æ å¿"]159 # çµæºå¼å
³160 d["power_button"] = ["//XCUIElementTypeOther[2]//XCUIElementTypeButton", "xpath", u"çµæºå¼å
³"]161 # çµæºç¶æ162 d["power_state"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[2]"163 "/XCUIElementTypeStaticText", "xpath", u"çµæºç¶æ"]164 # åç165 d["power"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther/XCUIElementTypeOther[2]/"166 "XCUIElementTypeStaticText", "xpath", u"åç"]167 # çµæºå¼å¯168 d["power_on"] = [u"设å¤å·²å¼å¯", "accessibility_id", u"çµæºå¼å¯"]169 # çµæºå
³é170 d["power_off"] = [u"设å¤å·²å
³é", "accessibility_id", u"çµæºå
³é"]171 # 设å¤è®°å¿æ¨¡å¼172 d["memory_mode"] = [u"è®°å¿æ¨¡å¼", "accessibility_id", u"设å¤è®°å¿æ¨¡å¼"]173 # 设å¤å®å
¨æ¨¡å¼174 d["safe_mode"] = [u"å®å
¨æ¨¡å¼", "accessibility_id", u"设å¤å®å
¨æ¨¡å¼"]175 # 模å¼å®æ¶176 d["mode_timer"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[3]",177 "xpath", u"模å¼å®æ¶"]178 # æ®éå®æ¶179 d["normal_timer"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[5]//XCUIElementTypeOther[2]", "xpath",180 u"æ®éå®æ¶"]181 # æ示ç¯182 d["led"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[10]/XCUIElementTypeButton", "xpath", u"æ示ç¯"]183 # ç¨çµé184 d["elec"] = [u"ç¨çµé", "accessibility_id", u"ç¨çµé"]185 # çµä»·è®¾ç½®186 d["set_elec"] = [u"çµä»·è®¾ç½®", "accessibility_id", u"çµä»·è®¾ç½®"]187 # çµè´¹188 d["elec_bill"] = [u"çµè´¹", "accessibility_id", u"çµè´¹"]189 # è¿å190 d["to_return"] = ["clos_bar", "accessibility_id", u"è¿å"]191 return d192 # 设å¤ä¿¡æ¯é¡µé¢193 def device_info_page(self):194 d = {}195 # æ é¢196 d["title"] = [u"设置", "accessibility_id", u"设å¤ä¿¡æ¯é¡µé¢"]197 # å é¤è®¾å¤æé®198 d["unbind"] = [u"å é¤è®¾å¤", "accessibility_id", u"å é¤è®¾å¤æé®"]199 # ç¼è¾è®¾å¤å¤æ³¨200 d["nickname"] = ["//XCUIElementTypeOther[2]//XCUIElementTypeTable/XCUIElementTypeButton", "xpath", u"ç¼è¾è®¾å¤å¤æ³¨"]201 # è¿åæé®202 d["to_return"] = ["gray back", "accessibility_id", u"è¿å"]203 return d204 # ä¿®æ¹è®¾å¤å¤æ³¨é¡µé¢205 def change_nickname_page(self):206 d = {}207 # æ é¢208 d["title"] = [u"ä¿®æ¹å称", "accessibility_id", u"ä¿®æ¹è®¾å¤å¤æ³¨é¡µé¢"]209 # ä¿å210 d["saved"] = [u"ä¿å", "accessibility_id", u"ä¿å"]211 # å¤æ³¨è¾å
¥æ¡212 d["nickname"] = ["//XCUIElementTypeTextField", "accessibility_id", u"å¤æ³¨è¾å
¥æ¡"]213 # è¿åæé®214 d["to_return"] = ["gray back", "accessibility_id", u"è¿å"]215 return d216 # 模å¼å®æ¶é¡µé¢217 def mode_timer_page(self):218 d = {}219 # æ é¢220 d["title"] = [u"èªå®ä¹æ¨¡å¼", "accessibility_id", u"模å¼å®æ¶é¡µé¢"]221 # çæ°´å¨æ¨¡å¼222 d["water_mode"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[4]", "xpath", u"çæ°´å¨æ¨¡å¼"]223 # çæ°´å¨æ¨¡å¼å¼å
³224 d["water_button"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/"225 "XCUIElementTypeOther", "xpath", u"çæ°´å¨æ¨¡å¼å¼å
³"]226 # 鱼缸模å¼227 d["fish_mode"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[8]", "xpath", u"鱼缸模å¼"]228 # 鱼缸模å¼å¼å
³229 d["fish_button"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[5]/XCUIElementTypeOther", "xpath",230 u"鱼缸模å¼å¼å
³"]231 # å
çµä¿æ¤æ¨¡å¼232 d["piocc_mode"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[12]", "xpath", u"å
çµä¿æ¤æ¨¡å¼"]233 # å
çµä¿æ¤æ¨¡å¼å¼å
³234 d["piocc_button"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[9]/XCUIElementTypeOther", "xpath",235 u"å
çµä¿æ¤æ¨¡å¼å¼å
³"]236 # è¿åæé®237 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]238 return d239 # çæ°´å¨æ¨¡å¼å®æ¶é¡µé¢240 def water_mode_timer_page(self):241 d = {}242 # æ é¢243 d["title"] = [u"çæ°´å¨æ¨¡å¼", "accessibility_id", u"çæ°´å¨æ¨¡å¼å®æ¶é¡µé¢"]244 # å¼å¯æ¶é´245 d["start_time"] = [u"æ座å¼å¯æ¶é´", "accessibility_id", u"æ座å¼å¯æ¶é´æ§ä»¶"]246 # å¼å¯æ¶é´247 d["start_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField", "xpath", u"æ座å¼å¯æ¶é´"]248 # å
³éæ¶é´249 d["end_time"] = [u"æ座å
³éæ¶é´", "accessibility_id", u"æ座å
³éæ¶é´æ§ä»¶"]250 # å
³éæ¶é´251 d["end_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField[2]", "xpath", u"æ座å
³éæ¶é´"]252 # æ¶é´æ»è½®,æ¶253 d["roll_h"] = [u"//XCUIElementTypeOther[@name='æ¶']", "xpath", u"æ¶é´æ»è½®,æ¶", {"px": [0.51, 0.5]}]254 # æ¶é´æ»è½®,å255 d["roll_m"] = [u"//XCUIElementTypeOther[@name='å']", "xpath", u"æ¶é´æ»è½®,å", {"px": [0.51, 0.5]}]256 # éå¤257 d["repeat"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[3]", "xpath", u"éå¤"]258 # 模å¼å称259 d["mode_name"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[4]", "xpath", u"模å¼å称"]260 # æ§è¡ç»æ261 d["result"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[5]", "xpath", u"æ§è¡ç»æ"]262 # åæ¶263 d["to_return"] = [u"åæ¶", "accessibility_id", u"åæ¶"]264 # å¯å¨265 d["launch"] = [u"å¯å¨", "accessibility_id", u"å¯å¨"]266 return d267 # 鱼缸模å¼å®æ¶é¡µé¢268 def fish_mode_timer_page(self):269 d = {}270 # æ é¢271 d["title"] = [u"鱼缸模å¼", "accessibility_id", u"鱼缸模å¼å®æ¶é¡µé¢"]272 # å¼å¯æ¶é´273 d["start_time"] = [u"æ座å¼å¯æ¶é¿", "accessibility_id", u"æ座å¼å¯æ¶é´æ§ä»¶"]274 # å¼å¯æ¶é´275 d["start_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField", "xpath", u"æ座å¼å¯æ¶é´"]276 # å
³éæ¶é´277 d["end_time"] = [u"æ座å
³éæ¶é¿", "accessibility_id", u"æ座å
³éæ¶é´æ§ä»¶"]278 # å
³éæ¶é´279 d["end_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField[2]", "xpath", u"æ座å
³éæ¶é´"]280 # æ¶é´æ»è½®,å°æ¶281 d["roll_h"] = [u"//XCUIElementTypeOther[@name='å°æ¶']", "xpath", u"æ¶é´æ»è½®,å°æ¶", {"px": [0.51, 0.5]}]282 # æ¶é´æ»è½®,åé283 d["roll_m"] = [u"//XCUIElementTypeOther[@name='åé']", "xpath", u"æ¶é´æ»è½®,åé", {"px": [0.51, 0.5]}]284 # éå¤285 d["repeat"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[3]", "xpath", u"éå¤"]286 # 模å¼å称287 d["mode_name"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[4]", "xpath", u"模å¼å称"]288 # åæ¶289 d["to_return"] = [u"åæ¶", "accessibility_id", u"åæ¶"]290 # å¯å¨291 d["launch"] = [u"å¯å¨", "accessibility_id", u"å¯å¨"]292 return d293 # å
çµä¿æ¤æ¨¡å¼å®æ¶é¡µé¢294 def piocc_mode_timer_page(self):295 d = {}296 # æ é¢297 d["title"] = [u"å
çµä¿æ¤æ¨¡å¼", "accessibility_id", u"å
çµä¿æ¤æ¨¡å¼å®æ¶é¡µé¢"]298 # å
³éæ¶é´299 d["end_time"] = [u"æ座延æ¶å
³éæ¶é¿", "accessibility_id", u"æ座延æ¶å
³éæ¶é¿æ§ä»¶"]300 # å
³éæ¶é´301 d["end_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField", "xpath", u"æ座延æ¶å
³éæ¶é¿"]302 # æ¶é´æ»è½®,å°æ¶303 d["roll_h"] = [u"//XCUIElementTypeOther[@name='å°æ¶']", "xpath", u"æ¶é´æ»è½®,å°æ¶", {"px": [0.51, 0.5]}]304 # æ¶é´æ»è½®,åé305 d["roll_m"] = [u"//XCUIElementTypeOther[@name='åé']", "xpath", u"æ¶é´æ»è½®,åé", {"px": [0.51, 0.5]}]306 # 模å¼å称307 d["mode_name"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[2]", "xpath", u"模å¼å称"]308 # æ§è¡ç»æ309 d["result"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[3]", "xpath", u"æ§è¡ç»æ"]310 # åæ¶311 d["to_return"] = [u"åæ¶", "accessibility_id", u"åæ¶"]312 # å¯å¨313 d["launch"] = [u"å¯å¨", "accessibility_id", u"å¯å¨"]314 return d315 # æ®éå®æ¶é¡µé¢316 def normal_timer_page(self):317 d = {}318 # æ é¢319 d["title"] = [u"å®æ¶è®¾ç½®", "accessibility_id", u"æ®éå®æ¶é¡µé¢"]320 # æ·»å å®æ¶321 d["add_timer"] = ["newAdd", "accessibility_id", u"æ·»å å®æ¶æé®"]322 # è¿åæé®323 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]324 # æ§è¡è®°å½325 d["timer_log"] = [u"æ§è¡è®°å½", "accessibility_id", u"æ§è¡è®°å½"]326 # ç¼è¾å®æ¶327 d["timer_edit"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[2]", "xpath", u"ç¼è¾å®æ¶", {"px": [0.95, 0.5]}]328 # æ å®æ¶329 d["no_timer"] = [u"ææ 设置å®æ¶", "accessibility_id", u"æ å®æ¶"]330 return d331 # æ°å»ºæ®éå®æ¶é¡µé¢332 def add_normal_timer_page(self):333 d = {}334 # æ é¢335 d["title"] = [u"æ°å»ºå®æ¶", "accessibility_id", u"æ°å»ºæ®éå®æ¶é¡µé¢"]336 # 设å®æ¶é´337 d["set_timer"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField", "xpath", u"设å®æ¶é´"]338 # æ¶é´æ»è½®,æ¶339 d["roll_h"] = [u"//XCUIElementTypeOther[@name='æ¶']", "xpath", u"æ¶é´æ»è½®,æ¶", {"px": [0.51, 0.5]}]340 # æ¶é´æ»è½®,å341 d["roll_m"] = [u"//XCUIElementTypeOther[@name='å']", "xpath", u"æ¶é´æ»è½®,å", {"px": [0.51, 0.5]}]342 # éå¤343 d["repeat"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[2]", "xpath", u"éå¤"]344 # å®æ¶å¼æº345 d["power_on"] = [u"å®æ¶å¼æº", "accessibility_id", u"å®æ¶å¼æº"]346 # å®æ¶å
³æº347 d["power_off"] = [u"å®æ¶å
³æº", "accessibility_id", u"å®æ¶å
³æº"]348 # å®æ¶å称349 d["timer_name"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[4]",350 "xpath", u"å®æ¶å称"]351 # æ§è¡ç»æéç¥352 d["timer_name"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[5]",353 "xpath", u"æ§è¡ç»æéç¥"]354 # åæ¶æé®355 d["to_return"] = [u"åæ¶", "accessibility_id", u"åæ¶"]356 # ä¿åæé®357 d["saved"] = [u"ä¿å", "accessibility_id", u"ä¿å"]358 return d359 # å®æ¶éå¤é¡µé¢360 def timer_repeat_page(self):361 d = {}362 # æ é¢363 d["title"] = [u"éå¤", "accessibility_id", u"å®æ¶éå¤é¡µé¢"]364 # éå¤æé®365 d["repeat_button"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/"366 "XCUIElementTypeOther", "xpath", u"éå¤æé®"]367 # æ§è¡ä¸æ¬¡368 d["once"] = [u"æ§è¡ä¸æ¬¡", "accessibility_id", u"æ§è¡ä¸æ¬¡"]369 # æ¯å¤©370 d["everyday"] = [u"æ¯å¤©", "accessibility_id", u"æ¯å¤©"]371 # å·¥ä½æ¥372 d["workday"] = [u"å·¥ä½æ¥", "accessibility_id", u"å·¥ä½æ¥"]373 # èªå®ä¹374 d["define"] = [u"èªå®ä¹", "accessibility_id", u"èªå®ä¹"]375 # å¨ä¸376 d["monday"] = [u"å¨ä¸", "accessibility_id", u"å¨ä¸"]377 # å¨äº378 d["tuesday"] = [u"å¨äº", "accessibility_id", u"å¨äº"]379 # å¨ä¸380 d["wednesday"] = [u"å¨ä¸", "accessibility_id", u"å¨ä¸"]381 # å¨å382 d["thursday"] = [u"å¨å", "accessibility_id", u"å¨å"]383 # å¨äº384 d["friday"] = [u"å¨äº", "accessibility_id", u"å¨äº"]385 # å¨å
386 d["saturday"] = [u"å¨å
", "accessibility_id", u"å¨å
"]387 # å¨æ¥388 d["weekday"] = [u"å¨æ¥", "accessibility_id", u"å¨æ¥"]389 # 鱼缸模å¼å¾ªç¯æé®390 d["fish_repeat_button"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/"391 "XCUIElementTypeOther/XCUIElementTypeOther", "xpath", u"鱼缸模å¼å¾ªç¯æé®"]392 # æ°¸ä¹
循ç¯393 d["forever"] = [u"æ°¸ä¹
循ç¯", "accessibility_id", u"æ°¸ä¹
循ç¯"]394 # æ§è¡æ¬¡æ°395 d["cycle_index"] = [u"æ§è¡æ¬¡æ°è®¾ç½®(次)", "accessibility_id", u"æ§è¡æ¬¡æ°"]396 # è¿åæé®397 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]398 return d399 # å®æ¶æ§è¡è®°å½é¡µé¢400 def timer_log_page(self):401 d = {}402 # æ é¢403 d["title"] = [u"æ§è¡è®°å½", "accessibility_id", u"å®æ¶æ§è¡è®°å½é¡µé¢"]404 # æ¸
空å®æ¶è®°å½405 d["clear"] = [u"æ¸
空", "accessibility_id", u"æ¸
空å®æ¶è®°å½"]406 # ææ§è¡è®°å½407 d["has_log"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther",408 "xpath", u"ææ§è¡è®°å½"]409 # æ æ§è¡è®°å½410 d["no_log"] = [u"ææ æ§è¡çºªå½ï¼", "accessibility_id", u"æ æ§è¡è®°å½"]411 # è¿åæé®412 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]413 return d414 # 设置çµä»·é¡µé¢415 def set_elec_page(self):416 d = {}417 # æ é¢418 d["title"] = [u"çµä»·è®¾ç½®", "accessibility_id", u"çµä»·è®¾ç½®é¡µé¢"]419 # åä¸çµä»·è®¾ç½®420 d["single_price"] = [u"åä¸çµä»· ", "accessibility_id", u"åä¸çµä»·è®¾ç½®"]421 # å³°è°·çµä»·è®¾ç½®422 d["peak_valley_price"] = [u"å³°è°·æ¶é´æ®µçµä»·", "accessibility_id", u"å³°è°·çµä»·è®¾ç½®"]423 # åä¸çµä»·è®¾ç½®æé®424 d["single_button"] = ["//XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/"425 "XCUIElementTypeOther/XCUIElementTypeOther", "xpath", u"åä¸çµä»·è®¾ç½®æé®"]426 # å³°è°·çµä»·è®¾ç½®æé®427 d["peak_valley_button"] = ["XCUIElementTypeWebView/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOth"428 "er/XCUIElementTypeOther[2]/XCUIElementTypeOther", "xpath", u"å³°è°·çµä»·è®¾ç½®æé®"]429 # è¿åæé®430 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]431 return d432 # åä¸çµä»·è®¾ç½®é¡µé¢433 def single_price_page(self):434 d = {}435 # æ é¢436 d["title"] = [u"åä¸çµä»·è®¾ç½®", "accessibility_id", u"åä¸çµä»·è®¾ç½®é¡µé¢"]437 # 设置çµä»·438 d["set_price"] = [u"//XCUIElementTypeTextField", "xpath", u"设置çµä»·"]439 # è¿åæé®440 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]441 return d442 # å³°è°·çµä»·è®¾ç½®é¡µé¢443 def peak_valley_price_page(self):444 d = {}445 # æ é¢446 d["title"] = [u"å³°è°·çµè®¾ç½®", "accessibility_id", u"å³°è°·çµä»·è®¾ç½®é¡µé¢"]447 # å¼å¯æ¶é´448 d["start_time"] = [u"å³°çµå¼å§æ¶é´", "accessibility_id", u"å³°çµå¼å§æ¶é´æ§ä»¶"]449 # å¼å¯æ¶é´450 d["start_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField", "xpath", u"å³°çµå¼å§æ¶é´"]451 # å
³éæ¶é´452 d["end_time"] = [u"å³°çµç»ææ¶é´", "accessibility_id", u"å³°çµç»ææ¶é´æ§ä»¶"]453 # å
³éæ¶é´454 d["end_time_text"] = ["//XCUIElementTypeWebView//XCUIElementTypeTextField[2]", "xpath", u"å³°çµç»ææ¶é´"]455 # æ¶é´æ»è½®,æ¶456 d["roll_h"] = [u"//XCUIElementTypeOther[@name='æ¶']", "xpath", u" æ¶é´æ»è½®,æ¶", {"px": [0.51, 0.5]}]457 # æ¶é´æ»è½®,å458 d["roll_m"] = [u"//XCUIElementTypeOther[@name='å']", "xpath", u"æ¶é´æ»è½®,å", {"px": [0.51, 0.5]}]459 # 设置峰çµçµä»·460 d["set_peak_price"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[4]//XCUIElementTypeTextField",461 "xpath", u"设置çµä»·"]462 # 设置谷çµçµä»·463 d["set_valley_price"] = ["//XCUIElementTypeWebView//XCUIElementTypeOther[8]//XCUIElementTypeTextField",464 "xpath", u"设置çµä»·"]465 # è¿åæé®466 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]467 return d468 # ç¨çµé页é¢469 def elec_page(self):470 d = {}471 # æ é¢472 d["title"] = [u"ç¨çµé", "accessibility_id", u"çµä»·è®¾ç½®é¡µé¢"]473 price_time = {}474 price_value = {}475 for i in xrange(24):476 price_time[i] = ("//XCUIElementTypeWebView//XCUIElementTypeOther[%s]/XCUIElementTypeOther/"477 "XCUIElementTypeStaticText" % (i + 4))478 price_value[i] = ("//XCUIElementTypeWebView//XCUIElementTypeOther[%s]/XCUIElementTypeOther[2]/"479 "XCUIElementTypeStaticText" % (i + 4))480 # çµéæ¶é´481 d["elec_time"] = [price_time, "xpath", u"çµéæ¶é´"]482 # çµéå¼483 d["elec_value"] = [price_value, "xpath", u"çµéå¼"]484 # æ¥485 d["day"] = [u"æ¥", "accessibility_id", u"æ¥"]486 # å¨487 d["week"] = [u"å¨", "accessibility_id", u"å¨"]488 # æ489 d["month"] = [u"æ", "accessibility_id", u"æ"]490 # å¹´491 d["year"] = [u"å¹´", "accessibility_id", u"å¹´"]492 # è¿åæé®493 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]494 return d495 # çµè´¹é¡µé¢496 def elec_bill_page(self):497 d = {}498 # æ é¢499 d["title"] = [u"çµè´¹", "accessibility_id", u"çµè´¹é¡µé¢"]500 price_time = {}501 price_value = {}502 for i in xrange(24):503 price_time[i] = ("//XCUIElementTypeWebView//XCUIElementTypeOther[%s]/XCUIElementTypeOther/"504 "XCUIElementTypeStaticText" % (i + 4))505 price_value[i] = ("//XCUIElementTypeWebView//XCUIElementTypeOther[%s]/XCUIElementTypeOther[2]/"506 "XCUIElementTypeStaticText" % (i + 4))507 # çµè´¹æ¶é´508 d["price_time"] = [price_time, "xpath", u"çµè´¹æ¶é´"]509 # çµè´¹å¼510 d["price_value"] = [price_value, "xpath", u"çµè´¹å¼"]511 # è¿åæé®512 d["to_return"] = ["gray_back", "accessibility_id", u"è¿å"]513 return d514class PopupWidgetIos(object):515 # appå级确认弹çª516 def update_popup(self):517 d = {}518 d["title"] = [u"æ´æ°æ示", "accessibility_id", u"ææ´æ°"]519 # ç¨åæé520 d["cancel"] = [u"ç¨åæé", "accessibility_id", u"ç¨åæé"]521 return d522 # FIXME:æ´æ°close_ad_popup523 def close_ad_popup(self):524 d = {}525 # 广åå
³éé®526 # d["title"] = [u"æä½å¤±è´¥ï¼è´¦å·å¨å
¶ä»ææºç»å½ï¼è¯·ç¡®è®¤æ¯å¦æ¬äººä½¿ç¨ã", "name", u"æ示 - éæ°ç»å½"]527 d["title"] = ["com.jd.smart:id/close_pop_for_top_news", "accessibility_id", u"åç°å¹¿å"]528 # 确认529 d["confirm"] = [u"确认", "accessibility_id", u"确认"]530 return d531 def unbind_device_popup(self):532 d = {}533 # å é¤è®¾å¤å¼¹çª534 d["title"] = [u"æ¨ç设å¤å°æå®æ¶ä»»å¡ï¼å»ºè®®æ¸
é¤å®æ¶ä»»å¡ååå é¤è®¾å¤", "accessibility_id", u"å é¤è®¾å¤æé®"]535 # 确认536 d["confirm"] = [u"ä»ç¶å é¤", "accessibility_id", u"确认"]537 # åæ¶538 d["cancel"] = [u"åæ¶", "accessibility_id", u"åæ¶"]539 return d540 def bind_device_fail_popup(self):541 d = {}542 # ç»å®å¤±è´¥543 d["title"] = [u"ç»å®å¤±è´¥", "accessibility_id", u"ç»å®å¤±è´¥"]544 # ç¡®å®545 d["confirm"] = [u"ç¡®å®", "accessibility_id", u"ç¡®å®"]546 # åæ¶547 d["cancel"] = [u"åæ¶", "accessibility_id", u"åæ¶"]548 return d549 def loading_popup(self):550 d = {}551 # æ é¢552 # d["title"] = ["loading...", "name", u"æ£å¨å è½½ä¸loading..."]553 d["title"] = ["android:id/message", "id", u"æ£å¨å è½½ä¸loading..."]554 return d555 def logout_popup(self):556 d = {}557 # éåºç»å½å¼¹çª558 d["title"] = [u"ç¡®å®è¦éåºå½åè´¦æ·ï¼", "accessibility_id", u"éåºç»å½å¼¹çª"]559 # ç¡®å®560 d["confirm"] = [u"ç¡®å®", "accessibility_id", u"ç¡®å®"]561 # åæ¶562 d["cancel"] = [u"åæ¶", "accessibility_id", u"åæ¶"]563 return d564 # å®æ¶æ§è¡è®°å½æ¸
é¤å¼¹çª565 def timer_log_clear_popup(self):566 d = {}567 # æ é¢568 d["title"] = [u"æ¯å¦æ¸
空记å½", "accessibility_id", u"æ¯å¦æ¸
空记å½"]569 # 确认570 d["confirm"] = [u"æ¯", "accessibility_id", u"确认"]571 # åæ¶572 d["cancel"] = [u"å¦", "accessibility_id", u"åæ¶"]573 return d574 # è¿æå®æ¶å é¤å¼¹çª575 def timer_edit_popup(self):576 d = {}577 # æ é¢578 d["title"] = [u"ç¼è¾", "accessibility_id", u"ç¼è¾"]579 # ç¼è¾580 d["edit"] = [u"ç¼è¾", "accessibility_id", u"ç¼è¾"]581 # å é¤582 d["delete"] = [u"å é¤", "accessibility_id", u"å é¤"]583 # åæ¶584 d["cancel"] = [u"åæ¶']", "accessibility_id", u"åæ¶"]585 return d586 # 模å¼å®æ¶å²çªå¼¹çª587 def mode_timer_conflict_popup(self):588 d = {}589 # æ é¢590 d["title"] = [u"å¼å¯æ°å®æ¶ï¼å°ä¼èªå¨å
³éå
¶ä»å®æ¶ï¼æ¯å¦ç¡®è®¤å¼å¯ï¼", "accessibility_id", u"模å¼å®æ¶å²çªå¼¹çª"]591 # ç¡®å®592 d["confirm"] = [u"æ¯", "accessibility_id", u"ç¡®å®"]593 # åæ¶594 d["cancel"] = [u"å¦", "accessibility_id", u"åæ¶"]...
test_nsaccessibilityprotocols.py
Source: test_nsaccessibilityprotocols.py
1from PyObjCTools.TestSupport import *2from AppKit import *3class TestNSAccessibilityProtocolsHelper (NSObject):4 def accessibilityOrientation(self): return 15 def setAccessibilityOrientation_(self, v): pass6 def accessibilityActivationPoint(self): return 17 def accessibilityAttributedStringForRange_(self, v): return 18 def accessibilityCellForColumn_row_(self, c, r): return 19 def accessibilityColumnCount(self): return 110 def accessibilityColumnIndexRange(self): return 111 def accessibilityDisclosureLevel(self): return 112 def accessibilityFrame(self): return 113 def accessibilityFrameForRange_(self, v): return 114 def accessibilityHorizontalUnits(self): return 115 def accessibilityIndex(self): return 116 def accessibilityInsertionPointLineNumber(self): return 117 def accessibilityLabelValue(self): return 118 def accessibilityLayoutPointForScreenPoint_(self, v): return 119 def accessibilityLayoutSizeForScreenSize_(self, v): return 120 def accessibilityLineForIndex_(self, v): return 121 def accessibilityNumberOfCharacters(self): return 122 def accessibilityPerformCancel(self): return 123 def accessibilityPerformConfirm(self): return 124 def accessibilityPerformDecrement(self): return 125 def accessibilityPerformDelete(self): return 126 def accessibilityPerformIncrement(self): return 127 def accessibilityPerformPick(self): return 128 def accessibilityPerformPress(self): return 129 def accessibilityPerformRaise(self): return 130 def accessibilityPerformShowAlternateUI(self): return 131 def accessibilityPerformShowDefaultUI(self): return 132 def accessibilityPerformShowMenu(self): return 133 def accessibilityRTFForRange_(self, v): return 134 def accessibilityRangeForIndex_(self, v): return 135 def accessibilityRangeForLine_(self, v): return 136 def accessibilityRangeForPosition_(self, v): return 137 def accessibilityRowCount(self): return 138 def accessibilityRowIndexRange(self): return 139 def accessibilityRulerMarkerType(self): return 140 def accessibilityScreenPointForLayoutPoint_(self, v): return 141 def accessibilityScreenSizeForLayoutSize_(self, v): return 142 def accessibilitySelectedTextRange(self): return 143 def accessibilitySharedCharacterRange(self): return 144 def accessibilitySortDirection(self): return 145 def accessibilityStringForRange_(self, v): return 146 def accessibilityStyleRangeForIndex_(self, v): return 147 def accessibilityUnits(self): return 148 def accessibilityVerticalUnits(self): return 149 def accessibilityVisibleCharacterRange(self): return 150 def isAccessibilityAlternateUIVisible(self): return 151 def isAccessibilityDisclosed(self): return 152 def setAccessibilityDisclosed_(self, v): pass53 def isAccessibilityEdited(self): return 154 def isAccessibilityElement(self): return 155 def isAccessibilityEnabled(self): return 156 def isAccessibilityExpanded(self): return 157 def isAccessibilityFocused(self): return 158 def isAccessibilityFrontmost(self): return 159 def isAccessibilityHidden(self): return 160 def isAccessibilityMain(self): return 161 def isAccessibilityMinimized(self): return 162 def isAccessibilityModal(self): return 163 def isAccessibilityOrderedByRow(self): return 164 def isAccessibilityProtectedContent(self): return 165 def isAccessibilitySelected(self): return 166 def isAccessibilitySelectorAllowed_(self, sel): return 167 def setAccessibilityActivationPoint_(self, p): pass68 def setAccessibilityAlternateUIVisible_(self, v): pass69 def setAccessibilityColumnCount_(self, v): pass70 def setAccessibilityColumnIndexRange_(self, v): pass71 def setAccessibilityDisclosureLevel_(self, v): pass72 def setAccessibilityEdited_(self, v): pass73 def setAccessibilityElement_(self, v): pass74 def setAccessibilityEnabled_(self, v): pass75 def setAccessibilityExpanded_(self, v): pass76 def setAccessibilityFocused_(self, v): pass77 def setAccessibilityFrame_(self, f): pass78 def setAccessibilityFrontmost_(self, v): pass79 def setAccessibilityHidden_(self, v): pass80 def setAccessibilityHorizontalUnits_(self, v): pass81 def setAccessibilityIndex_(self, v): pass82 def setAccessibilityInsertionPointLineNumber_(self, v): pass83 def setAccessibilityLabelValue_(self, v): pass84 def setAccessibilityMain_(self, v): return 185 def setAccessibilityMinimized_(self, v): return 186 def setAccessibilityModal_(self, v): return 187 def setAccessibilityNumberOfCharacters_(self, v): pass88 def setAccessibilityOrderedByRow_(self, v): pass89 def setAccessibilityProtectedContent_(self, v): pass90 def setAccessibilityRowCount_(self, v): pass91 def setAccessibilityRowIndexRange_(self, v): pass92 def setAccessibilityRulerMarkerType_(self, v): pass93 def setAccessibilitySelectedTextRange_(self, v): pass94 def setAccessibilitySelected_(self, v): pass95 def setAccessibilitySharedCharacterRange_(self, v): pass96 def setAccessibilitySortDirection_(self, v): pass97 def setAccessibilityUnits_(self, v): pass98 def setAccessibilityVerticalUnits_(self, v): pass99 def setAccessibilityVisibleCharacterRange_(self, v): pass100 def isAccessibilityRequired(self): return 1101class TestNSAccessibilityProtocols (TestCase):102 @min_sdk_level('10.10')103 def testProtocolObjects(self):104 self.assertIsInstance(objc.protocolNamed('NSAccessibilityGroup'), objc.formal_protocol)105 self.assertIsInstance(objc.protocolNamed('NSAccessibilityElement'), objc.formal_protocol)106 self.assertIsInstance(objc.protocolNamed('NSAccessibilityButton'), objc.formal_protocol)107 self.assertIsInstance(objc.protocolNamed('NSAccessibilitySwitch'), objc.formal_protocol)108 self.assertIsInstance(objc.protocolNamed('NSAccessibilityRadioButton'), objc.formal_protocol)109 self.assertIsInstance(objc.protocolNamed('NSAccessibilityCheckBox'), objc.formal_protocol)110 self.assertIsInstance(objc.protocolNamed('NSAccessibilityStaticText'), objc.formal_protocol)111 self.assertIsInstance(objc.protocolNamed('NSAccessibilityNavigableStaticText'), objc.formal_protocol)112 self.assertIsInstance(objc.protocolNamed('NSAccessibilityProgressIndicator'), objc.formal_protocol)113 self.assertIsInstance(objc.protocolNamed('NSAccessibilityStepper'), objc.formal_protocol)114 self.assertIsInstance(objc.protocolNamed('NSAccessibilitySlider'), objc.formal_protocol)115 self.assertIsInstance(objc.protocolNamed('NSAccessibilityImage'), objc.formal_protocol)116 self.assertIsInstance(objc.protocolNamed('NSAccessibilityContainsTransientUI'), objc.formal_protocol)117 self.assertIsInstance(objc.protocolNamed('NSAccessibilityTable'), objc.formal_protocol)118 self.assertIsInstance(objc.protocolNamed('NSAccessibilityOutline'), objc.formal_protocol)119 self.assertIsInstance(objc.protocolNamed('NSAccessibilityList'), objc.formal_protocol)120 self.assertIsInstance(objc.protocolNamed('NSAccessibilityRow'), objc.formal_protocol)121 self.assertIsInstance(objc.protocolNamed('NSAccessibilityLayoutArea'), objc.formal_protocol)122 self.assertIsInstance(objc.protocolNamed('NSAccessibilityLayoutItem'), objc.formal_protocol)123 self.assertIsInstance(objc.protocolNamed('NSAccessibility'), objc.formal_protocol)124 @min_sdk_level('10.13')125 def testProtocolObjects10_13(self):126 self.assertIsInstance(objc.protocolNamed('NSAccessibilityElementLoading'), objc.formal_protocol)127 def testProtocols(self):128 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityFocused)129 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrame, NSRect.__typestr__)130 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformPress)131 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformIncrement)132 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDecrement)133 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityVisibleCharacterRange, NSRange.__typestr__)134 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrameForRange_, 0, NSRange.__typestr__)135 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrameForRange_, NSRect.__typestr__)136 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityStringForRange_, 0, NSRange.__typestr__)137 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityLineForIndex_, 0, objc._C_NSInteger)138 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityLineForIndex_, objc._C_NSInteger)139 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForLine_, 0, objc._C_NSInteger)140 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForLine_, NSRange.__typestr__)141 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformIncrement)142 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDecrement)143 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformIncrement)144 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDecrement)145 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformIncrement)146 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDecrement)147 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformShowAlternateUI)148 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformShowDefaultUI)149 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityAlternateUIVisible)150 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityIndex, objc._C_NSInteger)151 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityDisclosureLevel, objc._C_NSInteger)152 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityFrame_, 0, NSRect.__typestr__)153 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityElement)154 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityElement_, 0)155 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrame, NSRect.__typestr__)156 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityFrame_, 0, NSRect.__typestr__)157 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityFocused)158 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityFocused_, 0)159 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityActivationPoint, NSPoint.__typestr__)160 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityActivationPoint_, 0, NSPoint.__typestr__)161 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityOrientation, objc._C_NSInteger)162 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityOrientation_, 0, objc._C_NSInteger)163 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilitySelected)164 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilitySelected_, 0)165 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityExpanded)166 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityExpanded_, 0)167 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityEdited)168 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityEdited_, 0)169 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityEnabled)170 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityEnabled_, 0)171 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityProtectedContent)172 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityProtectedContent_, 0)173 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityAlternateUIVisible)174 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityAlternateUIVisible_, 0)175 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityHidden)176 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityHidden_, 0)177 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityFrontmost)178 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityFrontmost_, 0)179 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityOrderedByRow)180 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityOrderedByRow_, 0)181 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityHorizontalUnits, objc._C_NSInteger)182 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityHorizontalUnits_, 0, objc._C_NSInteger)183 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityVerticalUnits, objc._C_NSInteger)184 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityVerticalUnits_, 0, objc._C_NSInteger)185 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityLayoutPointForScreenPoint_, NSPoint.__typestr__)186 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityLayoutPointForScreenPoint_, 0, NSPoint.__typestr__)187 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityLayoutSizeForScreenSize_, NSSize.__typestr__)188 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityLayoutSizeForScreenSize_, 0, NSSize.__typestr__)189 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityScreenPointForLayoutPoint_, NSPoint.__typestr__)190 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityScreenPointForLayoutPoint_, 0, NSPoint.__typestr__)191 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityScreenSizeForLayoutSize_, NSSize.__typestr__)192 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityScreenSizeForLayoutSize_, 0, NSSize.__typestr__)193 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityDisclosed)194 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityDisclosed_, 0)195 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityDisclosureLevel, objc._C_NSInteger)196 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityDisclosureLevel_, 0, objc._C_NSInteger)197 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityUnits, objc._C_NSInteger)198 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityUnits_, 0, objc._C_NSInteger)199 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRulerMarkerType, objc._C_NSInteger)200 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityRulerMarkerType_, 0, objc._C_NSInteger)201 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityLabelValue, objc._C_FLT)202 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityLabelValue_, 0, objc._C_FLT)203 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityColumnCount, objc._C_NSInteger)204 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityColumnCount_, 0, objc._C_NSInteger)205 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRowCount, objc._C_NSInteger)206 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityRowCount_, 0, objc._C_NSInteger)207 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityIndex, objc._C_NSInteger)208 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityIndex_, 0, objc._C_NSInteger)209 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilitySortDirection, objc._C_NSInteger)210 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilitySortDirection_, 0, objc._C_NSInteger)211 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityCellForColumn_row_, 0, objc._C_NSInteger)212 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityCellForColumn_row_, 1, objc._C_NSInteger)213 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRowIndexRange, NSRange.__typestr__)214 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityRowIndexRange_, 0, NSRange.__typestr__)215 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityColumnIndexRange, NSRange.__typestr__)216 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityColumnIndexRange_, 0, NSRange.__typestr__)217 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityInsertionPointLineNumber, objc._C_NSInteger)218 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityInsertionPointLineNumber_, 0, objc._C_NSInteger)219 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilitySharedCharacterRange, NSRange.__typestr__)220 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilitySharedCharacterRange_, 0, NSRange.__typestr__)221 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityVisibleCharacterRange, NSRange.__typestr__)222 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityVisibleCharacterRange_, 0, NSRange.__typestr__)223 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityNumberOfCharacters, objc._C_NSInteger)224 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilityNumberOfCharacters_, 0, objc._C_NSInteger)225 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilitySelectedTextRange, NSRange.__typestr__)226 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.setAccessibilitySelectedTextRange_, 0, NSRange.__typestr__)227 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForLine_, NSRange.__typestr__)228 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForLine_, 0, objc._C_NSInteger)229 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityAttributedStringForRange_, 0, NSRange.__typestr__)230 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityStringForRange_, 0, NSRange.__typestr__)231 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForPosition_, NSRange.__typestr__)232 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForPosition_, 0, NSPoint.__typestr__)233 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForIndex_, NSRange.__typestr__)234 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityRangeForIndex_, 0, objc._C_NSInteger)235 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrameForRange_, NSRect.__typestr__)236 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityFrameForRange_, 0, NSRange.__typestr__)237 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityRTFForRange_, 0, NSRange.__typestr__)238 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityStyleRangeForIndex_, NSRange.__typestr__)239 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityStyleRangeForIndex_, 0, objc._C_NSInteger)240 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityStyleRangeForIndex_, NSRange.__typestr__)241 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityStyleRangeForIndex_, 0, objc._C_NSInteger)242 self.assertResultHasType(TestNSAccessibilityProtocolsHelper.accessibilityLineForIndex_, objc._C_NSInteger)243 self.assertArgHasType(TestNSAccessibilityProtocolsHelper.accessibilityLineForIndex_, 0, objc._C_NSInteger)244 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityModal)245 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityModal_, 0)246 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityMain)247 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityMain_, 0)248 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityMinimized)249 self.assertArgIsBOOL(TestNSAccessibilityProtocolsHelper.setAccessibilityMinimized_, 0)250 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformCancel)251 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformConfirm)252 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDecrement)253 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformDelete)254 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformIncrement)255 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformPick)256 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformPress)257 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformRaise)258 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformShowAlternateUI)259 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformShowDefaultUI)260 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.accessibilityPerformShowMenu)261 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilitySelectorAllowed_)262 self.assertResultIsBOOL(TestNSAccessibilityProtocolsHelper.isAccessibilityRequired)263if __name__ == "__main__":...
locators.py
Source: locators.py
1from appium.webdriver.common.touch_action import TouchAction2from selenium.webdriver.common.by import By3class WelcomePageLocators:4 _joinus_button = {"by": By.ACCESSIBILITY_ID, "value": "welcomeLoginButton"}5 _login_button = {"by": By.ACCESSIBILITY_ID, "value": "welcomeRegistrationButton"}6class LoginPageLocators:7 _username_input = {"by": By.ACCESSIBILITY_ID, "value": "signInUsernameInput"}8 _password_input = {"by": By.ACCESSIBILITY_ID, "value": "signInPasswordInput"}9 _seepassword_button = {"by": By.ACCESSIBILITY_ID, "value": "signInPasswordInputEye"}10 _signin_button = {"by": By.ACCESSIBILITY_ID, "value": "signInLoginButton"}11 _back_button = {"by": By.ACCESSIBILITY_ID, "value": ""}12 _facebook_button = {"by": By.ACCESSIBILITY_ID, "value": ""}13 _vk_button = {"by": By.ACCESSIBILITY_ID, "value": ""}14 _forgot_password_button = {"by": By.ACCESSIBILITY_ID, "value": "signInForgetPassword"}15 _signup_button = {"by": By.ACCESSIBILITY_ID, "value": ""}16 _hs_logo = {"by": By.ACCESSIBILITY_ID, "value": ""}17 _wrong_username = {"by": By.ACCESSIBILITY_ID, "value": ""}18 _wrong_pass = {"by": By.ACCESSIBILITY_ID, "value": ""}19class SwipePageLocators:20 _photo_ = {"by": By.ACCESSIBILITY_ID, "value": "cardUserImage"}21 _dislike_button = {"by": By.ACCESSIBILITY_ID, "value": "swipeDislikeIcon"}22 _gift_button = {"by": By.ACCESSIBILITY_ID, "value": "swipeGiftIcon"}23 _like_button = {"by": By.ACCESSIBILITY_ID, "value": "swipeLikeIcon"}24 _filter_button = {"by": By.ACCESSIBILITY_ID, "value": "swipeFilterIcon"}25 _undo_button = {"by": By.ACCESSIBILITY_ID, "value": "swipeUndoIcon"}26 _location_value = {"by": By.ACCESSIBILITY_ID, "value": "userCardLocationValue"}27 _block_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardBlockOrReport"}28 _gift_card_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardSendGiftCardButtonText"}29 _user_name = {"by": By.ACCESSIBILITY_ID, "value": "cardUserFirstName"}30 _user_age = {"by": By.ACCESSIBILITY_ID, "value": "cardUserAge"}31 _report_abuse_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardReportAbuseButton"}32 _report_block_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardReportAbuseButton"}33 _cancel_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardBlockOrReportCancelButton"}34class IDlocators:35 _user_Id = {"by":By.ACCESSIBILITY_ID, "value": "reportAbuseScreenUserId"}36class BlocorReport:37 _report_abuse_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardReportAbuseButton"}38 _block_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardBlockUnblockButton"}39 _cancel_button = {"by": By.ACCESSIBILITY_ID, "value": "userCardBlockOrReportCancelButton"}40class MenuLocators:41 _search_button = {"by": By.XPATH, "value": "//android.widget.FrameLayout[@content-desc=\"Search, tab, 1 out of 4\"]/android.widget.TextView"}42 _swipe_button = {"by": By.XPATH, "value": "//android.widget.FrameLayout[@content-desc=\"Search, tab, 1 out of 4\"]/android.widget.TextView"}43 _chat_button = {"by": By.XPATH, "value": "//android.widget.FrameLayout[@content-desc=\"Chat, tab, 3 out of 4\"]/android.widget.ImageView"}44 _me_button = {"by": By.XPATH, "value": "//android.widget.FrameLayout[@content-desc=\"Me, tab, 4 out of 4\"]/android.widget.TextView"}45class SwipeFilterLocator:46 _save_button = {"by": By.ACCESSIBILITY_ID, "value": "filterHeaderCheckIcon"}47 _show_men_button = {"by": By.ACCESSIBILITY_ID, "value": "filterGenderButtonMen"}48 _show_women_button = {"by": By.ACCESSIBILITY_ID, "value": "filterGenderButtonWomen"}49 _show_both_button = {"by": By.ACCESSIBILITY_ID, "value": "filterGenderButtonBoth"}50 _location_button = {"by": By.ACCESSIBILITY_ID, "value": "filterLocationInputField"}51class SwipeLocationLocators:52 _search_box = {"by": By.ACCESSIBILITY_ID, "value": "cityAutocompleteSearchInput"}53 _cancel_button = {"by": By.ACCESSIBILITY_ID, "value": "cityAutocompleteCancel"}54 _current_location = {"by": By.ACCESSIBILITY_ID, "value": "cityAutocompleteCurrentLocationRow"}55 _line_results = {"by": By.ACCESSIBILITY_ID, "value": "cityAutocompleteCurrentLocationRow"}56class MyProfile:57 _settings_button = {"by": By.ACCESSIBILITY_ID, "value": "mainProfileSettingsIcon"}58 _need_help_button = {"by": By.ACCESSIBILITY_ID, "value": "//android.view.View[@content-desc=\"%3Fgclid%3DEAIaIQobChMIm8_bjYPY7wIVCca7CB1OOAP5EAEYASAAEgKyzPD_BwE\"]/android.view.View"}59 _credits_number = {"by": By.XPATH, "value": "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[4]/android.view.ViewGroup[1]/android.widget.TextView[1]"}60class Settings:61 _basic_info_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemBasic Info"}62 _fb_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemJoin HeySingles on Facebook"}63 _help_centre_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemHelp center"}64 _report_problem_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemReport a problem"}65 _account_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemAccount"}66 _linked_account_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemLinked Accounts"}67 _notifications_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemNotifications"}68 _privacy_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemPrivacy"}69 _invisible_mode_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemInvisible mode"}70 _verification_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemVerifications"}71 _payment_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemPayment Settings"}72 _language_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemApp Language"}73 _blocked_users_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemBlocked users"}74 _terms_of_use_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemTerms of Use"}75 _about_button = {"by": By.ACCESSIBILITY_ID, "value": "allMainSettingsItemAbout"}76class Account:77 _sign_out_button = {"by":By.ACCESSIBILITY_ID, "value": "signOutButton"}78 _hide_account_button = {"by":By.ACCESSIBILITY_ID, "value": "accountSettingsHideAccountSwitch"}79 _back_button = {"by": By.ACCESSIBILITY_ID, "value": "accountSettingsHideAccountSwitch"}80class BlockedUsers:81 _edit_button = {"by": By.ACCESSIBILITY_ID, "value": "Edit"}82 _cancel_button = {"by": By.ACCESSIBILITY_ID, "value": "Cancel"}83 _unblock_selected_button = {"by": By.ACCESSIBILITY_ID, "value": "blockedUsersUnblockSelectedButton"}84 _back_button = {"by": By.ACCESSIBILITY_ID, "value": "backButton"}85class GiftLocators:86 _romatic_gift_category = {"by": By.ACCESSIBILITY_ID, "value": "giftCategoryContainerRomatic"}87 _friendship_gift_category = {"by": By.ACCESSIBILITY_ID, "value": "giftCategoryContainerFriendship"}88 _birthday_gift_category = {"by": By.ACCESSIBILITY_ID, "value": "giftCategoryContainerBirthday"}89 _holidays_gift_category = {"by": By.ACCESSIBILITY_ID, "value": "giftCategoryContainerHolidays"}90 _select_gift_screen_category = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory"}91 _select_gift_screen_credits = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCredits"}92 _category = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory"}93 _gift_credits = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCredits"}94 _romantic_gift_selector_rose = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/1.png"}95 _romantic_gift_selector_kiss = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/2.png"}96 _romantic_gift_selector_heart = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/3.png"}97 _romantic_gift_selector_bear = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/4.png"}98 _romantic_gift_selector_heart_ring = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/5.png"}99 _romantic_gift_selector_chili = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/6.png"}100 _romantic_gift_selector_pearl = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/7.png"}101 _romantic_gift_selector_heart_rose = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/8.png"}102 _romantic_gift_selector_leaf_rose = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/9.png"}103 _romantic_gift_selector_basket_rose = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/10.png"}104 _romantic_gift_selector_cherry = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/11.png"}105 _romantic_gift_selector_diamond = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/12.png"}106 _friendship_gift_selector_coffee = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/13.png"}107 _friendship_gift_selector_flower = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/14.png"}108 _friendship_gift_selector_strawberry = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/15.png"}109 _friendship_gift_selector_cake = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/16.png"}110 _friendship_gift_selector_butterfly = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/17.png"}111 _friendship_gift_selector_cocktail = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/18.png"}112 _friendship_gift_selector_water_lily = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/19.png"}113 _friendship_gift_selector_balloon = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/20.png"}114 _birthday_gift_selector_cake = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/21.png"}115 _birthday_gift_selector_wishing = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/22.png"}116 _birthday_gift_selector_bear = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/23.png"}117 _birthday_gift_selector_rabbit = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/24.png"}118 _birthday_gift_selector_box = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/25.png"}119 _birthday_gift_selector_balloons = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/26.png"}120 _birthday_gift_selector_rose = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/27.png"}121 _birthday_gift_selector_champain = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/28.png"}122 _holiday_gift_selector_bunny = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/29.png"}123 _holiday_gift_selector_basket_of_eggs = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/30.png"}124 _holiday_gift_selector_egg = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/31.png"}125 _holiday_gift_selector_basket = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/32.png"}126 _holiday_gift_selector_christmas_tree = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/33.png"}127 _holiday_gift_selector_omela = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/34.png"}128 _holiday_gift_selector_hat = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/35.png"}129 _holiday_gift_selector_champain = {"by": By.ACCESSIBILITY_ID, "value": "selectGiftScreenCategory/images/virtual_gifts_new/36.png"}130 _gift_slider_left_arrow = {"by": By.ACCESSIBILITY_ID, "value": "giftSliderLeftArrow"}131 _gift_slider_right_arrow = {"by": By.ACCESSIBILITY_ID, "value": "giftSliderRightArrow"}132 _send_gift_screen_message_input = {"by": By.ACCESSIBILITY_ID, "value": "sendGiftScreenMessageInput"}133 _send_gift_screen_paid_button = {"by": By.ACCESSIBILITY_ID, "value": "sendPaidGiftButton"}134class Chat:135 _all_contacts = {"by": By.ACCESSIBILITY_ID, "value": "allConnections-connectionName}"}136 _chats = {"by": By.ACCESSIBILITY_ID, "value": "chats-connectionName}"}137 visits = {"by": By.ACCESSIBILITY_ID, "value": "visitors-connectionName}"}138 _winks = {"by": By.ACCESSIBILITY_ID, "value": "winks-connectionName}"}139 _favorites = {"by": By.ACCESSIBILITY_ID, "value": "favorites-connectionName}"}140 _birthday = {"by": By.ACCESSIBILITY_ID, "value": "birthdays-connectionName}"}141 _gifts = {"by": By.ACCESSIBILITY_ID, "value": "gifts-connectionName}"}142 _all_contacts_first_contact = {"by": By.XPATH, "value": "(//android.view.ViewGroup[@content-desc=\"chatUser\"])[1]"}143 _back_from_chat = {"by": By.XPATH, "value": "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]"}144 _chat_favorite = {"by": By.XPATH, "value": "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]"}...
Playwright error connection refused in docker
playwright-python advanced setup
How to select an input according to a parent sibling label
Error when installing Microsoft Playwright
Trouble waiting for changes to complete that are triggered by Python Playwright `select_option`
Capturing and Storing Request Data Using Playwright for Python
Can Playwright be used to launch a browser instance
Trouble in Clicking on Log in Google Button of Pop Up Menu Playwright Python
Scrapy Playwright get date by clicking button
React locator example
I solved my problem. In fact my docker container (frontend) is called "app" which is also domain name of fronend application. My application is running locally on http. Chromium and geko drivers force httpS connection for some domain names one of which is "app". So i have to change name for my docker container wich contains frontend application.
Check out the latest blogs from LambdaTest on this topic:
The sky’s the limit (and even beyond that) when you want to run test automation. Technology has developed so much that you can reduce time and stay more productive than you used to 10 years ago. You needn’t put up with the limitations brought to you by Selenium if that’s your go-to automation testing tool. Instead, you can pick from various test automation frameworks and tools to write effective test cases and run them successfully.
When it comes to web automation testing, there are a number of frameworks like Selenium, Cypress, PlayWright, Puppeteer, etc., that make it to the ‘preferred list’ of frameworks. The choice of test automation framework depends on a range of parameters like type, complexity, scale, along with the framework expertise available within the team. However, it’s no surprise that Selenium is still the most preferred framework among developers and QAs.
Playwright is a framework that I’ve always heard great things about but never had a chance to pick up until earlier this year. And since then, it’s become one of my favorite test automation frameworks to use when building a new automation project. It’s easy to set up, feature-packed, and one of the fastest, most reliable frameworks I’ve worked with.
The speed at which tests are executed and the “dearth of smartness” in testing are the two major problems developers and testers encounter.
With the rapidly evolving technology due to its ever-increasing demand in today’s world, Digital Security has become a major concern for the Software Industry. There are various ways through which Digital Security can be achieved, Captcha being one of them.Captcha is easy for humans to solve but hard for “bots” and other malicious software to figure out. However, Captcha has always been tricky for the testers to automate, as many of them don’t know how to handle captcha in Selenium or using any other test automation framework.
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!