mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Switch to a new more structured YAML format for navigation data.
Break everything into components.
This commit is contained in:
@@ -11,19 +11,19 @@ class AnonymousHistoriesTestCase(SeleniumTestCase):
|
||||
self.home()
|
||||
self.assert_initial_history_panel_state_correct()
|
||||
|
||||
tag_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["tagIcon"]
|
||||
anno_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["annoIcon"]
|
||||
self.assert_selector_absent(tag_icon_selector)
|
||||
self.assert_selector_absent(anno_icon_selector)
|
||||
tag_icon_selector = self.navigation.history_panel.selectors.tag_icon
|
||||
annotation_icon_selector = self.navigation.history_panel.selectors.annotation_icon
|
||||
self.assert_absent_or_hidden(tag_icon_selector)
|
||||
self.assert_absent_or_hidden(annotation_icon_selector)
|
||||
|
||||
name_selector = self.test_data["historyPanel"]["selectors"]["history"]["name"]
|
||||
name_element = self.wait_for_selector(name_selector)
|
||||
|
||||
# name should NOT be editable when clicked by anon-user
|
||||
editable_text_class = self.test_data["selectors"]["editableText"]
|
||||
assert editable_text_class not in name_element.get_attribute("class")
|
||||
# History has a name but...
|
||||
name_element = self.wait_for_present(self.navigation.history_panel.selectors.name)
|
||||
name_element.click()
|
||||
|
||||
# ... name should NOT be editable when clicked by anon-user
|
||||
editable_text_class = self.navigation._.selectors.editable_text
|
||||
assert editable_text_class.as_css_class not in name_element.get_attribute("class")
|
||||
|
||||
@selenium_test
|
||||
def test_anon_history_upload(self):
|
||||
self.home()
|
||||
@@ -35,8 +35,7 @@ class AnonymousHistoriesTestCase(SeleniumTestCase):
|
||||
assert 'state-ok' in element.get_attribute("class")
|
||||
|
||||
# empty should be NO LONGER be displayed
|
||||
empty_msg_selector = self.test_data["historyPanel"]["selectors"]["history"]["emptyMsg"]
|
||||
self.assert_selector_absent_or_hidden(empty_msg_selector)
|
||||
self.assert_absent_or_hidden(self.navigation.history_panel.selectors.empty_message)
|
||||
|
||||
@selenium_test
|
||||
def test_anon_history_after_registration(self):
|
||||
|
||||
@@ -14,7 +14,7 @@ class CollectionBuildersTestCase(SeleniumTestCase):
|
||||
self.history_panel_wait_for_hid_ok(1)
|
||||
self.history_panel_multi_operations_show()
|
||||
self.history_panel_muli_operation_select_hid(1)
|
||||
self.history_panel_multi_operation_action_click("Build Dataset List")
|
||||
self.history_panel_multi_operation_action_click(self.navigation.history_panel.multi_operations.labels.build_list)
|
||||
|
||||
self.collection_builder_set_name("my cool list")
|
||||
|
||||
@@ -27,7 +27,7 @@ class CollectionBuildersTestCase(SeleniumTestCase):
|
||||
self.history_panel_wait_for_hid_ok(1)
|
||||
self.history_panel_multi_operations_show()
|
||||
self.history_panel_muli_operation_select_hid(1)
|
||||
self.history_panel_multi_operation_action_click("Build Dataset List")
|
||||
self.history_panel_multi_operation_action_click(self.navigation.history_panel.multi_operations.labels.build_list)
|
||||
|
||||
self.collection_builder_hide_originals()
|
||||
self.collection_builder_set_name("my cool list")
|
||||
@@ -46,7 +46,7 @@ class CollectionBuildersTestCase(SeleniumTestCase):
|
||||
self.history_panel_multi_operations_show()
|
||||
self.history_panel_muli_operation_select_hid(1)
|
||||
self.history_panel_muli_operation_select_hid(2)
|
||||
self.history_panel_multi_operation_action_click("Build Dataset Pair")
|
||||
self.history_panel_multi_operation_action_click(self.navigation.history_panel.multi_operations.labels.build_pair)
|
||||
self.collection_builder_set_name("my awesome pair")
|
||||
|
||||
self.collection_builder_create()
|
||||
@@ -61,7 +61,7 @@ class CollectionBuildersTestCase(SeleniumTestCase):
|
||||
self.history_panel_multi_operations_show()
|
||||
self.history_panel_muli_operation_select_hid(1)
|
||||
self.history_panel_muli_operation_select_hid(2)
|
||||
self.history_panel_multi_operation_action_click("Build List of Dataset Pairs")
|
||||
self.history_panel_multi_operation_action_click(self.navigation.history_panel.multi_operations.labels.build_list_pairs)
|
||||
|
||||
self.collection_builder_clear_filters()
|
||||
self.collection_builder_click_paired_item("forward", 0)
|
||||
@@ -80,16 +80,15 @@ class CollectionBuildersTestCase(SeleniumTestCase):
|
||||
self.history_panel_multi_operations_show()
|
||||
self.history_panel_muli_operation_select_hid(1)
|
||||
self.history_panel_muli_operation_select_hid(2)
|
||||
self.history_panel_multi_operation_action_click("Build List of Dataset Pairs")
|
||||
self.history_panel_multi_operation_action_click(self.navigation.history_panel.multi_operations.labels.build_list_pairs)
|
||||
|
||||
clear_filter_link = self.wait_for_selector_visible("a.clear-filters-link")
|
||||
clear_filter_link.click()
|
||||
self.wait_for_and_click(self.navigation.collection_builders.selectors.clear_filters)
|
||||
|
||||
forward_column = self.wait_for_selector_visible(".forward-column .column-datasets")
|
||||
forward_column = self.wait_for_visible(self.navigation.collection_builders.selectors.forward_datasets)
|
||||
first_datset_forward = forward_column.find_elements_by_css_selector("li")[0]
|
||||
first_datset_forward.click()
|
||||
|
||||
reverse_column = self.wait_for_selector_visible(".reverse-column .column-datasets")
|
||||
reverse_column = self.wait_for_visible(self.navigation.collection_builders.selectors.reverse_datasets)
|
||||
second_dataset_reverse = reverse_column.find_elements_by_css_selector("li")[1]
|
||||
second_dataset_reverse.click()
|
||||
|
||||
|
||||
@@ -90,8 +90,6 @@ class CustomBuildsTestcase(SharedStateSeleniumTestCase):
|
||||
def navigate_to_custom_builds_page(self):
|
||||
self.home()
|
||||
self.click_masthead_user() # Open masthead menu
|
||||
label = self.navigation_data['labels']['masthead']['menus']['user']
|
||||
self.click_label(label)
|
||||
self.wait_for_and_click_selector('a[href="/custom_builds"]')
|
||||
|
||||
def setup_shared_state(self):
|
||||
|
||||
@@ -13,13 +13,13 @@ class HistoryOptionsTestCase(SeleniumTestCase):
|
||||
self.wait_for_history()
|
||||
self.click_history_options()
|
||||
|
||||
menu_selector = self.history_options_menu_selector()
|
||||
self.wait_for_selector_visible(menu_selector)
|
||||
menu_selector = self.navigation.history_panel.selectors.options_menu
|
||||
self.wait_for_visible(menu_selector)
|
||||
|
||||
# Click away closes history options
|
||||
self.click_center()
|
||||
|
||||
self.assert_selector_absent_or_hidden(menu_selector)
|
||||
self.wait_for_absent_or_hidden(menu_selector)
|
||||
|
||||
hda = self.latest_history_item()
|
||||
hid = hda["hid"]
|
||||
|
||||
@@ -11,13 +11,14 @@ class HistoryPanelTestCase(SeleniumTestCase):
|
||||
self.register()
|
||||
self.assert_initial_history_panel_state_correct()
|
||||
|
||||
tag_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["tagIcon"]
|
||||
anno_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["annoIcon"]
|
||||
self.assert_selector(tag_icon_selector)
|
||||
self.assert_selector(anno_icon_selector)
|
||||
tag_icon_selector = self.navigation.history_panel.selectors.tag_icon
|
||||
annotation_icon_selector = self.navigation.history_panel.selectors.annotation_icon
|
||||
|
||||
self.wait_for_visible(tag_icon_selector)
|
||||
self.wait_for_visible(annotation_icon_selector)
|
||||
|
||||
name_element = self.history_panel_name_element()
|
||||
self.assert_tooltip_text(name_element, self.test_data["historyPanel"]["text"]["history"]["tooltips"]["name"])
|
||||
self.assert_tooltip_text(name_element, self.navigation.history_panel.text.tooltip_name)
|
||||
|
||||
@selenium_test
|
||||
def test_history_panel_rename(self):
|
||||
@@ -34,7 +35,7 @@ class HistoryPanelTestCase(SeleniumTestCase):
|
||||
editable_text_input_element = self.history_panel_click_to_rename()
|
||||
editable_text_input_element.send_keys("New History Name")
|
||||
self.click_center()
|
||||
self.assert_selector_absent(self.history_panel_edit_title_input_selector())
|
||||
self.assert_absent(self.navigation.history_panel.selectors.name_edit_input)
|
||||
assert "New History Name" not in self.history_panel_name()
|
||||
|
||||
@selenium_test
|
||||
@@ -43,7 +44,7 @@ class HistoryPanelTestCase(SeleniumTestCase):
|
||||
editable_text_input_element = self.history_panel_click_to_rename()
|
||||
editable_text_input_element.send_keys("New History Name")
|
||||
self.send_escape(editable_text_input_element)
|
||||
self.assert_selector_absent(self.history_panel_edit_title_input_selector())
|
||||
self.assert_absent(self.navigation.history_panel.selectors.name_edit_input)
|
||||
assert "New History Name" not in self.history_panel_name()
|
||||
|
||||
@selenium_test
|
||||
@@ -51,34 +52,35 @@ class HistoryPanelTestCase(SeleniumTestCase):
|
||||
# TODO: Test actually editing these values.
|
||||
self.register()
|
||||
|
||||
tag_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["tagIcon"]
|
||||
anno_icon_selector = self.test_data["historyPanel"]["selectors"]["history"]["annoIcon"]
|
||||
tag_area_selector = self.test_data["historyPanel"]["selectors"]["history"]["tagArea"]
|
||||
anno_area_selector = self.test_data["historyPanel"]["selectors"]["history"]["annoArea"]
|
||||
tag_icon_selector = self.navigation.history_panel.selectors.tag_icon
|
||||
annotation_icon_selector = self.navigation.history_panel.selectors.annotation_icon
|
||||
|
||||
tag_icon = self.wait_for_selector_clickable(tag_icon_selector)
|
||||
annon_icon = self.wait_for_selector_clickable(anno_icon_selector)
|
||||
tag_area_selector = self.navigation.history_panel.selectors.tag_area
|
||||
annotation_area_selector = self.navigation.history_panel.selectors.annotation_area
|
||||
|
||||
self.assert_selector_absent_or_hidden(tag_area_selector)
|
||||
self.assert_selector_absent_or_hidden(anno_area_selector)
|
||||
tag_icon = self.wait_for_clickable(tag_icon_selector)
|
||||
annon_icon = self.wait_for_clickable(annotation_icon_selector)
|
||||
|
||||
self.assert_absent_or_hidden(tag_area_selector)
|
||||
self.assert_absent_or_hidden(annotation_area_selector)
|
||||
|
||||
tag_icon.click()
|
||||
|
||||
self.wait_for_selector(tag_area_selector)
|
||||
self.assert_selector_absent_or_hidden(anno_area_selector)
|
||||
self.wait_for_visible(tag_area_selector)
|
||||
self.assert_absent_or_hidden(annotation_area_selector)
|
||||
|
||||
tag_icon.click()
|
||||
self.sleep_for(self.wait_types.UX_TRANSITION)
|
||||
annon_icon.click()
|
||||
|
||||
self.wait_for_selector(anno_area_selector)
|
||||
self.assert_selector_absent_or_hidden(tag_area_selector)
|
||||
self.wait_for_visible(annotation_area_selector)
|
||||
self.assert_absent_or_hidden(tag_area_selector)
|
||||
|
||||
annon_icon.click()
|
||||
self.sleep_for(self.wait_types.UX_TRANSITION)
|
||||
|
||||
self.assert_selector_absent_or_hidden(tag_area_selector)
|
||||
self.assert_selector_absent_or_hidden(anno_area_selector)
|
||||
self.assert_absent_or_hidden(tag_area_selector)
|
||||
self.assert_absent_or_hidden(annotation_area_selector)
|
||||
|
||||
@selenium_test
|
||||
def test_refresh_preserves_state(self):
|
||||
|
||||
@@ -147,24 +147,23 @@ class HistoryGridTestCase(SharedStateSeleniumTestCase):
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
def set_annotation(self, annotation):
|
||||
anno_icon_selector = self.test_data['historyPanel']['selectors']['history']['annoIcon']
|
||||
anno_area_selector = self.test_data['historyPanel']['selectors']['history']['annoArea']
|
||||
self.ensure_annotation_area_displayed()
|
||||
|
||||
if not self.selector_is_displayed(anno_area_selector):
|
||||
self.wait_for_and_click_selector(anno_icon_selector)
|
||||
self.wait_for_and_click(self.navigation.history_panel.selectors.annotation_editable_text)
|
||||
|
||||
anno_area_selector += ' .annotation'
|
||||
self.wait_for_and_click_selector(anno_area_selector)
|
||||
annon_area_editable = self.wait_for_and_click(self.navigation.history_panel.selectors.annotation_edit)
|
||||
anno_done_button = self.wait_for_clickable(self.navigation.history_panel.selectors.annotation_done)
|
||||
|
||||
area_editable_selector = anno_area_selector + ' textarea'
|
||||
done_button_selector = anno_area_selector + ' button'
|
||||
annon_area_editable = self.wait_for_selector_clickable(area_editable_selector)
|
||||
anno_done_button = self.wait_for_selector_clickable(done_button_selector)
|
||||
|
||||
annon_area_editable.click()
|
||||
annon_area_editable.send_keys(annotation)
|
||||
anno_done_button.click()
|
||||
|
||||
def ensure_annotation_area_displayed(self):
|
||||
annotation_area_selector = self.navigation.history_panel.selectors.annotation_area
|
||||
annotation_icon_selector = self.navigation.history_panel.selectors.annotation_icon
|
||||
|
||||
if not self.is_displayed(annotation_area_selector):
|
||||
self.wait_for_and_click(annotation_icon_selector)
|
||||
|
||||
def setup_shared_state(self):
|
||||
tag1 = self._get_random_name(len=5)
|
||||
tag2 = self._get_random_name(len=5)
|
||||
@@ -210,8 +209,6 @@ class HistoryGridTestCase(SharedStateSeleniumTestCase):
|
||||
|
||||
def navigate_to_published_histories_page(self):
|
||||
self.home()
|
||||
self.click_masthead_user() # Open masthead menu
|
||||
self.click_label(
|
||||
self.navigation_data['labels']['masthead']['menus']['libraries'])
|
||||
self.click_masthead_libraries()
|
||||
selector = 'a[href="/histories/list_published"]'
|
||||
self.wait_for_and_click_selector(selector)
|
||||
|
||||
@@ -275,8 +275,6 @@ class SavedHistoriesTestCase(SharedStateSeleniumTestCase):
|
||||
def navigate_to_saved_histories_page(self):
|
||||
self.home()
|
||||
self.click_masthead_user() # Open masthead menu
|
||||
label = self.navigation_data['labels']['masthead']['menus']['user']
|
||||
self.click_label(label)
|
||||
self.wait_for_and_click_selector('a[href="/histories/list"]')
|
||||
|
||||
def setup_shared_state(self):
|
||||
|
||||
@@ -17,8 +17,8 @@ class UploadsTestCase(SeleniumTestCase, UsesHistoryItemAssertions):
|
||||
assert history_count == 1, "Incorrect number of items in history - expected 1, found %d" % history_count
|
||||
|
||||
hda = history_contents[0]
|
||||
assert hda["name"] == '1.sam'
|
||||
assert hda["extension"] == "sam"
|
||||
assert hda["name"] == '1.sam', hda
|
||||
assert hda["extension"] == "sam", hda
|
||||
|
||||
self.history_panel_click_item_title(hid=1, wait=True)
|
||||
self.assert_item_dbkey_displayed_as(1, "?")
|
||||
|
||||
Reference in New Issue
Block a user