Example #1
0
 def __init__(self, driver, locator_or_element, item_btn_locator=None):
     super(TreeViewItem, self).__init__(driver, locator_or_element)
     self.item_btn = (None if item_btn_locator is None else
                      selenium_utils.get_element_safe(
                          self.element, item_btn_locator))
     if self.item_btn:
         self.js_field_name = "instance"
     else:
         self.js_field_name = "itemData"
Example #2
0
 def item_type(self):
     """Item type defined by class of icon"""
     if not self._item_type:
         icon = selenium_utils.get_element_safe(
             self.element, self._locators.DROPDOWN_ITEM_ICON_CSS)
         if icon:
             icon_type = icon.get_attribute("class")
             self._item_type = next(
                 (v for k, v in self._elements.__dict__.iteritems()
                  if not k.startswith("_") and v in icon_type), icon_type)
     return self._item_type
Example #3
0
 def item_type(self):
   """Item type defined by class of icon"""
   if not self._item_type:
     icon = selenium_utils.get_element_safe(
         self.element, self._locators.DROPDOWN_ITEM_ICON_CSS)
     if icon:
       icon_type = icon.get_attribute("class")
       self._item_type = next(
           (v for k, v in self._elements.__dict__.iteritems()
            if not k.startswith("_") and v in icon_type),
           icon_type)
   return self._item_type
Example #4
0
 def __init__(self, driver, locator_or_element, item_btn_locator=None):
   super(TreeViewItem, self).__init__(driver, locator_or_element)
   self.item_btn = (
       None if item_btn_locator is None else
       selenium_utils.get_element_safe(
           self.element, item_btn_locator))
Example #5
0
 def __init__(self, driver, locator_or_element, item_btn_locator=None):
   super(TreeViewItem, self).__init__(driver, locator_or_element)
   self.item_btn = (
       None if item_btn_locator is None else
       selenium_utils.get_element_safe(
           self.element, item_btn_locator))