From 17728bdfa23a3cd9d5576e5ed4bd281c63476959 Mon Sep 17 00:00:00 2001 From: g1879 Date: Thu, 21 Dec 2023 17:08:30 +0800 Subject: [PATCH] =?UTF-8?q?4.0.0b25wait.ele=5Fdisplay()=E6=94=B9=E6=88=90w?= =?UTF-8?q?ait.ele=5Fdisplayed()=EF=BC=9Bwait.display()=E6=94=B9=E6=88=90w?= =?UTF-8?q?ait.displayed()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/_units/waiter.py | 6 +++--- DrissionPage/_units/waiter.pyi | 4 ++-- README.md | 10 ++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/DrissionPage/_units/waiter.py b/DrissionPage/_units/waiter.py index 042a0e6..9393e6a 100644 --- a/DrissionPage/_units/waiter.py +++ b/DrissionPage/_units/waiter.py @@ -29,7 +29,7 @@ class BaseWaiter(object): 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 - 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 timeout: 超时时间,默认读取页面超时时间 @@ -46,7 +46,7 @@ class BaseWaiter(object): raise WaitTimeoutError('等待元素显示失败。') else: 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): """等待元素变成隐藏状态 @@ -316,7 +316,7 @@ class ElementWaiter(object): """ 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显示 :param timeout: 超时时间,为None使用元素所在页面timeout属性 :param raise_err: 等待失败时是否报错,为None时根据Settings设置 diff --git a/DrissionPage/_units/waiter.pyi b/DrissionPage/_units/waiter.pyi index 1782f86..94803ef 100644 --- a/DrissionPage/_units/waiter.pyi +++ b/DrissionPage/_units/waiter.pyi @@ -23,7 +23,7 @@ class BaseWaiter(object): timeout: float = None, raise_err: bool = None) -> bool: ... - def ele_display(self, + def ele_displayed(self, loc_or_ele: Union[str, tuple, ChromiumElement], timeout: float = None, raise_err: bool = None) -> bool: ... @@ -78,7 +78,7 @@ class ElementWaiter(object): 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: ... diff --git a/README.md b/README.md index 49e9d7f..d775971 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,7 @@ python 版本:3.6 及以上 **📖 使用文档:** [点击查看](https://g1879.gitee.io/drissionpagedocs) -**交流 QQ 群:** 897838127[已满]、558778073[已满]、636361957 - ---- - -# 🔥 新版预告 - -查看下一步开发计划:[新版预告](https://g1879.gitee.io/drissionpagedocs/whatsnew/3_3/) +**交流 QQ 群:** 636361957 --- @@ -56,7 +50,7 @@ python 版本:3.6 及以上 # 💡 理念 -简洁!易用 !方便! +简洁而强大! ---