@@ -944,6 +944,13 @@ def is_element_visible(self, selector, by="css selector"):
944
944
return self.__is_shadow_element_visible(selector)
945
945
return page_actions.is_element_visible(self.driver, selector, by)
946
946
947
+ def is_element_clickable(self, selector, by="css selector"):
948
+ self.wait_for_ready_state_complete()
949
+ selector, by = self.__recalculate_selector(selector, by)
950
+ if self.__is_shadow_selector(selector):
951
+ return self.__is_shadow_element_clickable(selector)
952
+ return page_actions.is_element_clickable(self.driver, selector, by)
953
+
947
954
def is_element_enabled(self, selector, by="css selector"):
948
955
self.wait_for_ready_state_complete()
949
956
selector, by = self.__recalculate_selector(selector, by)
@@ -7013,6 +7020,20 @@ def __is_shadow_element_visible(self, selector):
7013
7020
except Exception:
7014
7021
return False
7015
7022
7023
+ def __is_shadow_element_clickable(self, selector):
7024
+ from selenium.webdriver.support import expected_conditions as EC
7025
+ from selenium.webdriver.support.ui import WebDriverWait
7026
+
7027
+ try:
7028
+ element = self.__get_shadow_element(selector, timeout=0.1)
7029
+ if element.is_displayed() and WebDriverWait(self.driver, 0).until(
7030
+ EC.element_to_be_clickable(element)
7031
+ ):
7032
+ return True
7033
+ return False
7034
+ except Exception:
7035
+ return False
7036
+
7016
7037
def __is_shadow_element_enabled(self, selector):
7017
7038
try:
7018
7039
element = self.__get_shadow_element(selector, timeout=0.1)
0 commit comments