Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
g1879 2024-09-14 17:23:58 +08:00
commit 4f88a04810
5 changed files with 10 additions and 6 deletions

View File

@ -31,6 +31,8 @@ class SessionElementsList(list):
def __getitem__(self, _i) -> Union[SessionElement, List[SessionElement]]: ...
def __iter__(self) -> List[SessionElement]: ...
@property
def get(self) -> Getter:
"""返回用于属性的对象"""
@ -63,6 +65,8 @@ class ChromiumElementsList(SessionElementsList):
def __getitem__(self, _i) -> Union[ChromiumElement, List[ChromiumElement]]: ...
def __iter__(self) -> List[ChromiumElement]: ...
@property
def filter(self) -> ChromiumFilter:
"""返回用于筛选多个元素的对象"""

View File

@ -104,8 +104,8 @@ class MixTab(SessionPage, ChromiumTab, BasePage):
return self.response
def ele(self, locator, index=1, timeout=None):
return super(SessionPage, self).ele(locator, index=index, timeout=timeout) if self._d_mode \
else super().ele(locator, index=index)
return (super(SessionPage, self).ele(locator, index=index, timeout=timeout)
if self._d_mode else super().ele(locator, index=index))
def eles(self, locator, timeout=None):
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)

View File

@ -215,7 +215,7 @@ class MixTab(SessionPage, ChromiumTab):
def eles(self,
locator: Union[Tuple[str, str], str],
timeout: float = None) -> ChromiumElementsList:
timeout: float = None) -> Union[ChromiumElementsList, SessionElementsList]:
"""返回页面中所有符合条件的元素、属性或节点文本
:param locator: 元素的定位信息可以是loc元组或查询字符串
:param timeout: 查找元素超时时间默认与页面等待时间一致

View File

@ -128,8 +128,8 @@ class WebPage(SessionPage, ChromiumPage, BasePage):
return super().post(url, show_errmsg, retry, interval, **kwargs)
def ele(self, locator, index=1, timeout=None):
return super(SessionPage, self).ele(locator, index=index, timeout=timeout) if self._d_mode \
else super().ele(locator, index=index)
return (super(SessionPage, self).ele(locator, index=index, timeout=timeout)
if self._d_mode else super().ele(locator, index=index))
def eles(self, locator, timeout=None):
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)

View File

@ -230,7 +230,7 @@ class WebPage(SessionPage, ChromiumPage, BasePage):
def eles(self,
locator: Union[Tuple[str, str], str],
timeout: float = None) -> ChromiumElementsList:
timeout: float = None) -> Union[ChromiumElementsList, SessionElementsList]:
"""返回页面中所有符合条件的元素、属性或节点文本
:param locator: 元素的定位信息可以是loc元组或查询字符串
:param timeout: 查找元素超时时间默认与页面等待时间一致