def test_gs_graph_cocacola_search1(self): """ #需要执行的case """ self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("通用").click() time.sleep(2) album_icon = self.mp.driver.find_element_by_name("底部工具条 打开相册") album_icon.click() time.sleep(2) look_album_icon = self.mp.driver.find_element_by_name("查看相册") look_album_icon.click() time.sleep(2) personal_save = self.mp.driver.find_element_by_xpath( "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[3]/XCUIElementTypeButton[1]" ) personal_save.click() st = int(time.time()) #coca cola search_config = CaseConfig() search_file = search_config.get_picture_name("cocacola") self.mp.driver.find_element_by_name(search_file).click() time.sleep(15) #assert (True == search_config.check_search_result(st, "cocacola")) log_check = search_config.check_search_result(st, "cocacola") if log_check == True: print "gs_graph_cocacola_search1 log check is ture" else: print "gs_graph_cocacola_search1 log check is false"
def test_gs_graph_folower_search(self): """ #需要执行的case """ self.mp.enter_into_graph_search() self.mp.driver.find_element_by_name("通用").click() time.sleep(2) self.mp.from_graph_sdk_goto_pic_select() st = int(time.time()) #folower search_config = CaseConfig() search_file = search_config.get_picture_name("folower") self.mp.driver.find_element_by_name(search_file).click() time.sleep(5) self.mp.driver.find_element_by_name(self.graph_icon).click() time.sleep(5) #assert (True == search_config.check_search_result(st,"flower")) log_check = search_config.check_search_result(st, "flower") if log_check == True: print "gs_graph_folower_search log check is ture" else: print "gs_graph_folower_search log check is false"
def test_scan_text_search2(self): """ 返回手百首页 """ try: self.mp.driver.find_element_by_name( "BBAUIKit.bundle/BBAToolBar/BBAToolBarSystemItemImage1001bgStyle1.png" ).click() print "click homepage button" except: print "We have been on the homepage" self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("扫一扫").click() time.sleep(2) self.mp.from_graph_sdk_goto_pic_select() #商品条形码 search_config = CaseConfig() search_file = search_config.get_picture_name("scan_product") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #回到图搜 self.mp.driver.find_element_by_name(self.graph_icon).click() time.sleep(5)
def test_scan_text_search(self): """ 需要执行的case """ self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("翻译").click() time.sleep(7) self.mp.from_graph_sdk_goto_pic_select() #翻译垂类 search_config = CaseConfig() search_file = search_config.get_picture_name("translate_search") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #获取屏幕长度 x = self.mp.driver.get_window_size()['width'] y = self.mp.driver.get_window_size()['height'] #涂抹操作:(参数1:起始点横坐标;参数2:起始点纵坐标;参数3:角度;参数4:滑动距离) self.mp.driver.swipe(x * 0.2, y * 0.3, 0, y * 0.2) time.sleep(5) #搜索 self.mp.driver.find_element_by_name("icon ok normal zh").click() time.sleep(5) #重涂 try: self.mp.driver.find_element_by_name("icon furbish normal").click() except: #翻译失败 self.mp.driver.find_element_by_name("我知道了").click() time.sleep(2) self.mp.driver.find_element_by_name("icon furbish normal").click() time.sleep(2) #切换语种 self.mp.driver.find_element_by_name("picker change").click() time.sleep(2) self.mp.driver.swipe(x * 0.6, y * 0.3, 0, y * 0.2) time.sleep(5) self.mp.driver.find_element_by_name("icon ok normal zh").click() time.sleep(5) #重拍 try: self.mp.driver.find_element_by_name("icon retake normal").click() except: self.mp.driver.find_element_by_name("我知道了").click() time.sleep(2) self.mp.driver.find_element_by_name("icon retake normal").click() time.sleep(5)
def test_scan_text_search1(self): """ 需要执行的case """ self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("扫一扫").click() time.sleep(2) self.mp.from_graph_sdk_goto_pic_select() #商品条形码 search_config = CaseConfig() search_file = search_config.get_picture_name("scan_product") self.mp.driver.find_element_by_name(search_file).click() time.sleep(5)
def test_gs_graph_cocacola_search2(self): """ 返回手百首页 """ try: self.mp.driver.find_element_by_name( "BBAUIKit.bundle/BBAToolBar/BBAToolBarSystemItemImage1001bgStyle1.png" ).click() print "click homepage button" except: print "We have been on the homepage" self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("通用").click() time.sleep(2) album_icon = self.mp.driver.find_element_by_name("底部工具条 打开相册") album_icon.click() time.sleep(2) look_album_icon = self.mp.driver.find_element_by_name("查看相册") look_album_icon.click() time.sleep(2) personal_save = self.mp.driver.find_element_by_xpath( "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[3]/XCUIElementTypeButton[1]" ) personal_save.click() st = int(time.time()) #coca cola search_config = CaseConfig() search_file = search_config.get_picture_name("cocacola") self.mp.driver.find_element_by_name(search_file).click() time.sleep(15) self.mp.driver.find_element_by_name(self.graph_icon).click() time.sleep(5) #assert (True == search_config.check_search_result(st, "cocacola")) log_check = search_config.check_search_result(st, "cocacola") if log_check == True: print "gs_graph_cocacola_search2 log check is ture" else: print "gs_graph_cocacola_search2 log check is false"
def test_scan_text_search1(self): """ 需要执行的case """ self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("题目").click() time.sleep(7) self.mp.from_graph_sdk_goto_pic_select() #题目垂类 search_config = CaseConfig() search_file = search_config.get_picture_name("title_search") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #发起搜索 self.mp.driver.find_element_by_name("mis image editor search").click() time.sleep(5)
def test_scan_text_search(self): """ 需要执行的case """ self.mp.enter_into_graph_search() general_icon=self.mp.driver.find_element_by_name("扫一扫").click() time.sleep(2) self.mp.from_graph_sdk_goto_pic_select() #名片二维码 search_config = CaseConfig() search_file=search_config.get_picture_name("scan_care") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #点返回按钮,回到图搜 self.mp.driver.find_element_by_name("bookmark back button normal").click() time.sleep(5)
def test_scan_text_search(self): """ 需要执行的case """ self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("扫一扫").click() time.sleep(2) self.mp.from_graph_sdk_goto_pic_select() #支付二维码 search_config = CaseConfig() search_file = search_config.get_picture_name("scan_pay") self.mp.driver.find_element_by_name(search_file).click() time.sleep(5) #点返回按钮,回到首页 self.mp.driver.find_element_by_name("account login close").click() time.sleep(2) self.mp.driver.find_element_by_xpath( "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeButton[1]" ) time.sleep(2)
def test_scan_text_search2(self): """ 返回手百首页 """ try: self.mp.driver.find_element_by_name( "BBAUIKit.bundle/BBAToolBar/BBAToolBarSystemItemImage1001bgStyle1.png" ).click() print "click homepage button" except: print "We have been on the homepage" self.mp.enter_into_graph_search() general_icon = self.mp.driver.find_element_by_name("题目").click() time.sleep(7) self.mp.from_graph_sdk_goto_pic_select() #题目垂类 search_config = CaseConfig() search_file = search_config.get_picture_name("title_search") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #旋转90度 self.mp.driver.find_element_by_name( "mis image editor rotate normal").click() time.sleep(2) #重拍 self.mp.driver.find_element_by_name("mis image editor remake").click() self.mp.from_graph_sdk_goto_pic_select() search_config = CaseConfig() search_file = search_config.get_picture_name("title_search") self.mp.driver.find_element_by_name(search_file).click() time.sleep(3) #发起搜索 self.mp.driver.find_element_by_name("mis image editor search").click() time.sleep(5) self.mp.driver.find_element_by_name("框选").click() time.sleep(2) self.mp.driver.find_element_by_name("mis image editor search").click() time.sleep(5) self.mp.driver.find_element_by_name("重拍").click() time.sleep(5)