Beispiel #1
0
    def open_map(self):
        """Click to Map button on Tree View to open unified mapper modal.

    Return: lib.page.modal.unified_mapper.MapObjectsModal
    """
        base.Button(self._driver, self._locators.MAP_BTN_CSS).click()
        return unified_mapper.MapObjectsModal(self._driver, self.obj_name)
Beispiel #2
0
def map_object_via_unified_mapper(selenium,
                                  obj_name,
                                  dest_objs_type=None,
                                  obj_to_map=None,
                                  return_tree_items=False,
                                  open_in_new_frontend=False,
                                  proceed_in_new_tab=False):
    """Maps selected obj to dest_obj_type via Unified Mapper.
  Returns:
    MapObjectsModal instance.
  """
    assert dest_objs_type or obj_to_map, ("At least one of params "
                                          "should be provided.")
    if not dest_objs_type:
        dest_objs_type = obj_to_map._obj_name()
    map_modal = unified_mapper.MapObjectsModal(driver=selenium,
                                               obj_name=obj_name)
    map_modal.search_dest_objs(dest_objs_type=dest_objs_type,
                               return_tree_items=return_tree_items)
    if open_in_new_frontend:
        map_modal.open_in_new_frontend_btn.click()
    else:
        if obj_to_map:
            dest_obj_modal = map_modal.click_create_and_map_obj()
            dest_obj_modal.submit_obj(obj_to_map)
        if proceed_in_new_tab:
            object_modal.WarningModal().proceed_in_new_tab()
    return map_modal
Beispiel #3
0
    def open_map(self):
        """Click to Map button on Tree View to open unified mapper modal.

    Return: lib.page.modal.unified_mapper.MapObjectsModal
    """
        self._browser.link(text="Map").click()
        return unified_mapper.MapObjectsModal(self._driver, self.obj_name)
Beispiel #4
0
 def open_map(self):
     """Click to Map button on Tree View to open unified mapper modal.
 Return: lib.page.modal.unified_mapper.MapObjectsModal
 """
     _locator_map = (By.CSS_SELECTOR,
                     self._locators.BUTTON_MAP.format(self.widget_name))
     base.Button(self._driver, _locator_map).click()
     return unified_mapper.MapObjectsModal(self._driver, self.obj_name)
Beispiel #5
0
 def select_map(self):
     """
 Click on "Map to this object" button in dropdown. Before this, check
 whether the dropdown is display. If no open it
 Returns:
 Unified mapper
 """
     self.get_dropdown_item(self._elements.MAP).click()
     return unified_mapper.MapObjectsModal(self._driver, self.obj_name)
Beispiel #6
0
 def select_map(self):
     """
 Click on "Map to this object" button in dropdown. Before this, check
 whether the dropdown is display. If no open it
 Returns:
 Unified mapper
 """
     if not self.dropdown_element.is_displayed():
         selenium_utils.hover_over_element(self._driver, self.dropdown_btn)
         self.dropdown_btn.click()
     self.get_dropdown_item(self._elements.MAP).click()
     return unified_mapper.MapObjectsModal(self._driver, self.obj_name)
Beispiel #7
0
def map_object_via_unified_mapper(selenium,
                                  obj_name,
                                  dest_objs_type,
                                  return_tree_items=True,
                                  open_in_new_frontend=False):
    """Maps selected obj to dest_obj_type via Unified Mapper."""
    modal = unified_mapper.MapObjectsModal(driver=selenium, obj_name=obj_name)
    modal.search_dest_objs(dest_objs_type=dest_objs_type,
                           return_tree_items=return_tree_items)
    if open_in_new_frontend:
        modal.open_in_new_frontend_btn.click()
    else:
        raise NotImplementedError
    return modal