def exported_objs_via_tree_view(self, path_to_export_dir, widget): """Exports objects to test's temporary directory as CSV file. Returns: list of objects from CSV file in test's temporary directory 'path_to_export_dir'.""" widget.tree_view.open_3bbs().select_export() page = export_page.ExportPage(self._driver) page.open_export_page() return self.get_list_objs_from_csv( page.download_obj_to_csv(path_to_export_dir))
def select_export(self): """Select Export objects in 3BBS dropdown modal to open Export Page with Export Panel witch contains pre-filled object type (mapped objects type) and filter by mapping (source object title). Return: lib.page.export_page.ExportPage """ base.Button(self._driver, self._locators.BTN_3BBS_EXPORT_CSS).click() selenium_utils.switch_to_new_window(self._driver) return export_page.ExportPage(self._driver)
def select_export(self): """Select Export objects in 3BBS dropdown modal to open Export Page with Export Panel witch contains pre-filled object type (mapped objects type) and filter by mapping (source object title). Return: lib.page.export_page.ExportPage """ _locator_export = (By.CSS_SELECTOR, self._locators.BUTTON_3BBS_EXPORT.format( self.widget_name)) base.Button(self._driver, _locator_export).click() selenium_utils.switch_to_new_window(self._driver) return export_page.ExportPage(self._driver)
def export_objs_via_tree_view(self, path_to_export_dir, src_obj): # pylint: disable=fixme """Open generic widget of mapped objects and export objects to test's temporary directory as CSV file. Get and return path to the exported file. """ objs_widget = self.open_widget_of_mapped_objs(src_obj) objs_widget.tree_view.open_3bbs().select_export() export_page_object = export_page.ExportPage(self.driver) export_page_object.open_export_page() path_to_exported_file = export_page_object.download_obj_to_csv( path_to_export_dir) # FIXME: Filename was "{obj_type} {snapshot_obj_type} # before migration of export page on background job. # Current behavior may be a bug. if self.snapshot_obj_type: obj_part = self.snapshot_obj_type else: obj_part = self.obj_type obj_part = "{}_".format(obj_part) assert os.path.basename(path_to_exported_file).startswith(obj_part) is True return path_to_exported_file