diff --git a/lib/galaxy/selenium/navigation.yml b/lib/galaxy/selenium/navigation.yml index a0f85f1df76..06e72921e4b 100644 --- a/lib/galaxy/selenium/navigation.yml +++ b/lib/galaxy/selenium/navigation.yml @@ -605,6 +605,7 @@ libraries: export_to_history_paired_option: 'option[value="${collection_option}"]' export_to_history_collection_name: '.collection-name' export_to_history_new_history: 'input[name=history_name]' + clear_filters: '.clear-filters-link' import_progress_bar: '.progress-bar-import' import_history_content: '.library_selected_history_content' import_history_contents_items: '.library_selected_history_content tbody > tr' diff --git a/lib/galaxy_test/selenium/test_library_to_collections.py b/lib/galaxy_test/selenium/test_library_to_collections.py index 3d36ff7099e..ea8a41bd1c3 100644 --- a/lib/galaxy_test/selenium/test_library_to_collections.py +++ b/lib/galaxy_test/selenium/test_library_to_collections.py @@ -25,16 +25,25 @@ class LibraryToCollectionsTestCase(SeleniumTestCase, UsesLibraryAssertions): def test_library_pair_export_new_history(self): self.collection_export(is_new_history=True, collection_option="paired") - def prepare_library_for_data_export(self, files_to_import=["1.bam", "1.bed"]): + @selenium_test + def test_export_pairs_list(self): + self.list_of_pairs_export() + + @selenium_test + def test_export_pairs_list_new_history(self): + self.list_of_pairs_export(is_new_history=True) + + def prepare_library_for_data_export(self, files_to_import=["1.bam", "1.bed"], is_new_history=False): self.navigate_to_new_library() self.assert_num_displayed_items_is(0) self.populate_library_folder_from_import_dir(self.name, files_to_import) - - self.components.libraries.folder.select_dataset(rowindex=1).wait_for_and_click() - self.components.libraries.folder.select_dataset(rowindex=2).wait_for_and_click() + for i in range(len(files_to_import)): + self.components.libraries.folder.select_dataset(rowindex=i + 1).wait_for_and_click() self.components.libraries.folder.add_to_history.wait_for_and_click() - self.screenshot("libraries_add_to_history_menu") self.components.libraries.folder.add_to_history_collection.wait_for_and_click() + if is_new_history: + random_name = self._get_random_name() + self.components.libraries.folder.export_to_history_new_history.wait_for_and_send_keys(random_name) def build_collection_and_assert(self): self.collection_builder_set_name(self._get_random_name()) @@ -43,11 +52,9 @@ class LibraryToCollectionsTestCase(SeleniumTestCase, UsesLibraryAssertions): self.history_panel_wait_for_hid_ok(3) def collection_export(self, is_new_history=False, collection_option=None): - self.prepare_library_for_data_export() + self.prepare_library_for_data_export(is_new_history) self.components.libraries.folder.export_to_history_options.wait_for_and_click() - if is_new_history: - random_name = self._get_random_name() - self.components.libraries.folder.export_to_history_new_history.wait_for_and_send_keys(random_name) + if collection_option is not None: self.components.libraries.folder.export_to_history_paired_option( collection_option=collection_option).wait_for_and_click() @@ -56,3 +63,19 @@ class LibraryToCollectionsTestCase(SeleniumTestCase, UsesLibraryAssertions): self.build_collection_and_assert() if is_new_history: assert self.history_panel_name_element().text == random_name + + def list_of_pairs_export(self, is_new_history=False): + self.prepare_library_for_data_export(["bam_from_sam.bam", "asian_chars_1.txt", "1.bam", "1.bed"]) + self.components.libraries.folder.export_to_history_options.wait_for_and_click() + self.components.libraries.folder.export_to_history_paired_option(collection_option="list:paired").wait_for_and_click() + self.screenshot(f'test_export_pairs_list={is_new_history}') + self.components.libraries.folder.import_datasets_ok_button.wait_for_and_click() + self.components.libraries.folder.clear_filters.wait_for_and_click() + self.collection_builder_click_paired_item("forward", 0) + self.collection_builder_click_paired_item("reverse", 1) + self.components.libraries.folder.export_to_history_collection_name.wait_for_and_send_keys(self._get_random_name()) + self.collection_builder_create() + self.home() + self.history_panel_wait_for_hid_ok(3) + self.history_panel_wait_for_hid_hidden(1) + self.history_panel_wait_for_hid_hidden(2)