SeldomQA / poium

Page Objects design pattern test library, support selenium、appium、playwright, etc
https://pypi.org/project/poium
Apache License 2.0
416 stars 140 forks source link

PageWait 如果元素进入判断None为,休眠未重新获取对象,导致一直为None #12

Closed kuaidanian closed 5 months ago

kuaidanian commented 4 years ago

`class PageWait(object):

def __init__(self, elm, timeout=3):
    """
    wait webelement display
    """
    try:
        timeout_int = int(timeout)
    except TypeError:
        raise ValueError("Type 'timeout' error, must be type int() ")

    for i in range(timeout_int):
        if elm is not None:
            if elm.is_displayed() is True:
                break
            else:
                sleep(1)
        else:
            sleep(1)
    else:
        raise TimeoutError("Timeout, element invisible")`

elm进Pagewait判断的时候如果是个空置,休眠后应该再重新去获取对象

klookAppTest commented 4 years ago

该方法不推荐使用!