implement export list of pairs

This commit is contained in:
Oleg Zharkov
2021-04-07 16:03:53 +03:00
parent 7be9e0006d
commit ef1d06ba31
2 changed files with 33 additions and 9 deletions
+1
View File
@@ -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'
@@ -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)