Ejemplo n.º 1
0
def get_widget_menu(driver,key='微件'):
    test = Action(driver)
    touchAction = TouchAction(driver)
    windows_height = test.get_windows_height()
    windows_width = test.get_windows_width()
    for x in range(4):
        if x == 0:
            xx = windows_width/3
            yy = windows_height/3
        elif x == 1:
            xx = windows_width / 3
            yy = windows_height * 2 / 3
        elif x == 2:
            xx = windows_width * 2 / 3
            yy = windows_height * 2 / 3
        else:
            xx = windows_width * 2 / 3
            yy = windows_height / 3
        touchAction.long_press(x=xx ,y=yy)
        time.sleep(2)
        touchAction.release().perform()
        time.sleep(0.3)
        tmp = test.find_list_byid(bubble_text,key)
        if tmp is not None:
            return tmp
    return None
Ejemplo n.º 2
0
def widget_list_swipe_Down(dev):
    test = Action(dev)
    for x in range(10):
        if test.find_list_byid(widget_name,'音乐') is not None:
            return test.find_list_byid(widget_name,'音乐')
        test.swipe_Down(600,1)
        time.sleep(0.2)
    return None
Ejemplo n.º 3
0
def wait_X(dev,cls,key,timeout=3,isKey=False):
    """
    :param dev: dev
    :param cls: 元素类名
    :param key: 元素文本名
    :param timeout: 超时
    :param isKey: 是否精确匹配文本
    :return: 元素
    """
    test = Action(dev)
    tmp = None
    for x in range(timepit):
        tmp = test.find_byclass(cls, key, isKey)
        if tmp is not None:
            return tmp
        time.sleep(1)
    return None
Ejemplo n.º 4
0
 def __init__(self, dev, failkey):
     self.driver = dev
     self.test = Action(self.driver)
     self.Case = TestCase()
     self.failkey = failkey
Ejemplo n.º 5
0
 def __init__(self, dev, failkey):
     self.driver = dev
     self.test = Action(self.driver)
     self.Case = TestCase()
     self.failkey = failkey
     self.new_name = TimeUtils.str_HMS_Name()
Ejemplo n.º 6
0
 def setUpClass(cls) -> None:
     # 此方法,当前测试类执行前执行,即 测试初始化
     cls.driver = TestResult.getDvicer()
     cls.caseMethod = Music_Video_CaseMethod(cls.driver, 'case_Music_A_test_if_base')
     test = Action(cls.driver)