修复is_displayed小问题

This commit is contained in:
g1879 2024-01-01 23:34:34 +08:00
parent d1a87654a1
commit f2e147a7e2

View File

@ -27,9 +27,8 @@ class ElementStates(object):
@property
def is_displayed(self):
"""返回元素是否显示"""
return not (self._ele.style('visibility') == 'hidden'
or self._ele.run_js('return this.offsetParent === null;')
or self._ele.style('display') == 'none')
return not (self._ele.style('visibility') == 'hidden' or self._ele.run_js('return this.offsetParent === null;')
or self._ele.style('display') == 'none' or self._ele.prop('hidden'))
@property
def is_enabled(self):