def clear_cache_cancel(self, case_name, second):  #清理缓存点取消
     try:
         time.sleep(second)
         my_page = MyPage()
         util = Utils()
         util.getElementById(MyHelper.driver, my_page.resid_my_button)
         # 点击清理缓存,会弹出确认框
         util.getElementById(MyHelper.driver,
                             my_page.resid_clear_cache).click()
         # 由于uiauto定位不到确认框元素,此处采用绝对定位
         # 取消  128  680,245-744
         # 确定  449  695,600 746
         # 点击取消
         time.sleep(2)
         util.tap(MyHelper.driver, 128, 680, 245, 744)
         if second > 0:
             util.take_screenShot(MyHelper.driver, case_name, second)
         else:
             util.take_screenShot(MyHelper.driver, case_name, 0)
     except Exception as e:
         print("发现异常")
         print(e)
         Utils.getElementById(self, MyHelper.driver,
                              MyPage.resid_back_button)
         raise SystemError
 def to_cash_with_drawl(self,case_name):
     try:
         util=Utils()
         util.getElementById(CashWithDrawalHelper.driver,MyPage.resid_my_button).click()
         util.getElementById(CashWithDrawalHelper.driver,MyPage.resid_my_record).click()
         util.take_screenShot(CashWithDrawalHelper.driver, case_name, 2)
         util.getElementById(CashWithDrawalHelper.driver,MyPage.resid_back_button).click()
     except Exception as e:
         print("发现异常")
         print(e)
         raise SystemError
    def to_exhibition_room(self, case_name, second):
        try:
            time.sleep(second)
            my_page = MyPage()
            util = Utils()
            util.getElementById(MyHelper.driver,
                                my_page.resid_exhibitionRoom_button).click()
            print("点击大奖展厅完成")
            if second > 0:
                util.take_screenShot(MyHelper.driver, case_name, second)
            else:
                util.take_screenShot(MyHelper.driver, case_name, 0)

            pass
        except Exception as e:
            print("发现异常")
            print(e)
            raise SystemError
Example #4
0
 def Talk(self, text, case_name, second):
     try:
         # 点击输入框并输入,发送
         Utils.getElementById(HotAnchorPage.resid_edit_mess).send_keys(text)
         Utils.getElementById(HotAnchorPage.resid_send_mess).click()
         if second > 0:
             Utils.take_screenShot(HotAnchorHelper.driver, case_name,
                                   second)
             # Utils.getImage(HotAnchorHelper.driver, case_name, second)
         else:
             Utils.take_screenShot(HotAnchorHelper.driver, case_name,
                                   second)
             # Utils.getImage(HotAnchorHelper.driver, case_name, 0)
         print("本次测试完成")
     except Exception as e:
         print("发现异常")
         print(e)
         raise SystemError
Example #5
0
    def Talkd(self, case_name, second):
        try:
            Utils.getElementById(HotAnchorPage.resid_edit_mess).click()
            # 点击表情,选择一个表情扔出去!,发送
            # 坐标点击表情呀~~~

            Utils.getElementById(HotAnchorPage.resid_send_mess).click()
            if second > 0:
                Utils.take_screenShot(HotAnchorHelper.driver, case_name,
                                      second)
                # Utils.getImage(HotAnchorHelper.driver, case_name, second)
            else:
                Utils.take_screenShot(HotAnchorHelper.driver, case_name,
                                      second)
                # Utils.getImage(HotAnchorHelper.driver, case_name, 0)
            print("本次测试完成")
        except Exception as e:
            print("发现异常")
            print(e)
            raise SystemError