4.0.0b25wait.ele_display()改成wait.ele_displayed();wait.display()改成wait.displayed()

This commit is contained in:
g1879 2023-12-21 17:08:30 +08:00
parent 4de95e6354
commit 17728bdfa2
3 changed files with 7 additions and 13 deletions

View File

@ -29,7 +29,7 @@ class BaseWaiter(object):
ele = self._driver._ele(loc_or_ele, raise_err=False, timeout=0) ele = self._driver._ele(loc_or_ele, raise_err=False, timeout=0)
return ele.wait.deleted(timeout, raise_err=raise_err) if ele else True return ele.wait.deleted(timeout, raise_err=raise_err) if ele else True
def ele_display(self, loc_or_ele, timeout=None, raise_err=None): def ele_displayed(self, loc_or_ele, timeout=None, raise_err=None):
"""等待元素变成显示状态 """等待元素变成显示状态
:param loc_or_ele: 要等待的元素可以是已有元素定位符 :param loc_or_ele: 要等待的元素可以是已有元素定位符
:param timeout: 超时时间默认读取页面超时时间 :param timeout: 超时时间默认读取页面超时时间
@ -46,7 +46,7 @@ class BaseWaiter(object):
raise WaitTimeoutError('等待元素显示失败。') raise WaitTimeoutError('等待元素显示失败。')
else: else:
return False return False
return ele.wait.display(timeout, raise_err=raise_err) return ele.wait.displayed(timeout, raise_err=raise_err)
def ele_hidden(self, loc_or_ele, timeout=None, raise_err=None): def ele_hidden(self, loc_or_ele, timeout=None, raise_err=None):
"""等待元素变成隐藏状态 """等待元素变成隐藏状态
@ -316,7 +316,7 @@ class ElementWaiter(object):
""" """
return self._wait_state('is_alive', False, timeout, raise_err, err_text='等待元素被删除失败。') return self._wait_state('is_alive', False, timeout, raise_err, err_text='等待元素被删除失败。')
def display(self, timeout=None, raise_err=None): def displayed(self, timeout=None, raise_err=None):
"""等待元素从dom显示 """等待元素从dom显示
:param timeout: 超时时间为None使用元素所在页面timeout属性 :param timeout: 超时时间为None使用元素所在页面timeout属性
:param raise_err: 等待失败时是否报错为None时根据Settings设置 :param raise_err: 等待失败时是否报错为None时根据Settings设置

View File

@ -23,7 +23,7 @@ class BaseWaiter(object):
timeout: float = None, timeout: float = None,
raise_err: bool = None) -> bool: ... raise_err: bool = None) -> bool: ...
def ele_display(self, def ele_displayed(self,
loc_or_ele: Union[str, tuple, ChromiumElement], loc_or_ele: Union[str, tuple, ChromiumElement],
timeout: float = None, timeout: float = None,
raise_err: bool = None) -> bool: ... raise_err: bool = None) -> bool: ...
@ -78,7 +78,7 @@ class ElementWaiter(object):
def deleted(self, timeout: float = None, raise_err: bool = None) -> bool: ... def deleted(self, timeout: float = None, raise_err: bool = None) -> bool: ...
def display(self, timeout: float = None, raise_err: bool = None) -> bool: ... def displayed(self, timeout: float = None, raise_err: bool = None) -> bool: ...
def hidden(self, timeout: float = None, raise_err: bool = None) -> bool: ... def hidden(self, timeout: float = None, raise_err: bool = None) -> bool: ...

View File

@ -32,13 +32,7 @@ python 版本3.6 及以上
**📖 使用文档:** [点击查看](https://g1879.gitee.io/drissionpagedocs) **📖 使用文档:** [点击查看](https://g1879.gitee.io/drissionpagedocs)
**交流 QQ 群:** 897838127[已满]、558778073[已满]、636361957 **交流 QQ 群:** 636361957
---
# 🔥 新版预告
查看下一步开发计划:[新版预告](https://g1879.gitee.io/drissionpagedocs/whatsnew/3_3/)
--- ---
@ -56,7 +50,7 @@ python 版本3.6 及以上
# 💡 理念 # 💡 理念
简洁!易用 !方便 简洁而强大
--- ---