Esempio n. 1
0
 def language_switch(self,language = 2):
     #language = 1 为中文
     if language == 1:
         cn = opencv_aircv.check_pic_xy(pic_ordermanage.order_pic().language["cn"])
         if cn is None:
             self.k.tap_key(self.k.shift_key)
     else:
         english = opencv_aircv.check_pic_xy(pic_ordermanage.order_pic().language["english"])
         if english is None:
             self.k.tap_key(self.k.shift_key)
     time.sleep(1)
Esempio n. 2
0
 def scroll_exist_content(self,checkpic): #参数为图片的路径
     xy = opencv_aircv.check_pic_xy(checkpic)
     if xy is None:
         #print("次找不到" + checkpic)
         pass
     else:
         return xy
Esempio n. 3
0
 def is_exist_pic(self,checkpic):#参数为图片的路径
     i = 0.5
     while i <= 2:
         xy = opencv_aircv.check_pic_xy(checkpic)
         if xy is None:
             time.sleep(i)
             i = i + 0.5
             if i == 2.5: #页面找不到元素,截图到对应的nofound文件夹
                 #print("当前页面找不到"+checkpic)
                 picpath = self.creat_dir(checkpic)
                 picname = "\\" + os.path.split(checkpic)[1]
                 #print(picpath+picname)
                 shot_screen2.window_capture(picpath+picname)
                 logger.error(picname + "页面不存在:")
                 raise TimeoutError
         else:
             return xy
Esempio n. 4
0
 def assert_pic(self,checkpic,second = 1): #checkpic为图片文件夹的路径,second 为验证等待时间,默认1秒,图片0.2秒验证一次
     i = 0.2
     while i <= second:
         xy = opencv_aircv.check_pic_xy(checkpic)
         if xy is None:
             #print("第"+str(int(i)+1) + "次找不到" + checkpic)
             time.sleep(i)
             i = i + 0.2
             if i == second:
                 #print("当前页面找不到"+checkpic)
                 picpath = self.creat_dir(checkpic)
                 picname = "\\" + os.path.split(checkpic)[1]
                 #print(picpath+picname)
                 shot_screen2.window_capture(picpath+picname)
                 logger.error("页面不存在:" + picname)
                 return 0
         else:
             return 1
Esempio n. 5
0
 def click_listbox(self,y,n,pianx=0,piany=0):
     self.doubleclick(y)
     time.sleep(0.5)
     box_xy = opencv_aircv.check_pic_xy(n)
     self.m.click(box_xy[0],box_xy[1],1)
     time.sleep(0.5)