mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Adjust histories advanced filter selenium tests
This commit is contained in:
@@ -47,6 +47,7 @@ function hasCondition(conditionHandler: (rowData: RowData, config: GalaxyConfigu
|
||||
<button
|
||||
v-if="operation && operation.condition && hasCondition(operation.condition)"
|
||||
class="dropdown-item"
|
||||
:data-description="`grid operation ${operation.title.toLowerCase()}`"
|
||||
@click.prevent="emit('execute', operation)">
|
||||
<icon :icon="operation.icon" />
|
||||
<span v-localize>{{ operation.title }}</span>
|
||||
|
||||
@@ -433,10 +433,13 @@ histories:
|
||||
selectors:
|
||||
advanced_search_toggle: '#histories-grid [data-description="toggle advanced search"]'
|
||||
advanced_search_name_input: '#histories-advanced-filter-name'
|
||||
advanced_search_tag_input: '#histories-advanced-filter-tag .stateless-tags'
|
||||
advanced_search_filter: '#histories-grid [data-description="filter ${filter}"] .btn'
|
||||
advanced_search_submit: '#histories-advanced-filter-submit'
|
||||
import_button: '[data-description="grid action import new history"]'
|
||||
advanced_search_tag_input: '#histories-advanced-filter-tag .stateless-tags'
|
||||
histories: '.grid-table tr'
|
||||
import_button: '[data-description="grid action import new history"]'
|
||||
reset_input: '#histories-grid [data-description="reset query"]'
|
||||
search_input: '#histories-grid input.search-query[data-description="filter text input"]'
|
||||
sharing:
|
||||
selectors:
|
||||
unshare_user_button: '.share_with_view .multiselect__tag-icon'
|
||||
@@ -1048,8 +1051,8 @@ libraries:
|
||||
|
||||
grids:
|
||||
selectors:
|
||||
body: '#grid-table-body'
|
||||
free_text_search: '#input-free-text-search-filter'
|
||||
body: '.grid-table'
|
||||
free_text_search: '[data-description="filter text input"]'
|
||||
|
||||
gies:
|
||||
jupyter:
|
||||
|
||||
@@ -541,20 +541,22 @@ class NavigatesGalaxy(HasDriver):
|
||||
return history_item_selector_state
|
||||
|
||||
def click_grid_popup_option(self, item_name, option_label):
|
||||
item_button = None
|
||||
target_item = None
|
||||
grid = self.components.grids.body.wait_for_visible()
|
||||
for row in grid.find_elements(By.TAG_NAME, "tr"):
|
||||
name_cell = row.find_elements(By.TAG_NAME, "td")[1]
|
||||
if name_cell.text == item_name:
|
||||
item_button = name_cell
|
||||
name_cell = row.find_elements(By.TAG_NAME, "td")[0]
|
||||
if item_name in name_cell.text:
|
||||
target_item = name_cell
|
||||
break
|
||||
|
||||
if item_button is None:
|
||||
if target_item is None:
|
||||
raise AssertionError(f"Failed to find item with name [{item_name}]")
|
||||
|
||||
popup_menu_button = item_button.find_element(By.CSS_SELECTOR, ".dropdown-toggle")
|
||||
popup_menu_button = target_item.find_element(By.CSS_SELECTOR, "button")
|
||||
popup_menu_button.click()
|
||||
popup_option = self.driver.find_element(By.LINK_TEXT, option_label)
|
||||
popup_option = target_item.find_element(
|
||||
By.CSS_SELECTOR, f"[data-description='grid operation {option_label.lower()}'"
|
||||
)
|
||||
popup_option.click()
|
||||
|
||||
def published_grid_search_for(self, search_term=None):
|
||||
|
||||
@@ -42,13 +42,13 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
self.navigate_to_histories_page()
|
||||
|
||||
# Publish the history
|
||||
self.click_grid_popup_option(self.history2_name, "Share or Publish")
|
||||
self.click_grid_popup_option(self.history2_name, "Share and Publish")
|
||||
self.make_accessible_and_publishable()
|
||||
|
||||
self.navigate_to_histories_page()
|
||||
|
||||
self.histories_click_advanced_search()
|
||||
self.select_filter("sharing", "published")
|
||||
self.components.histories.advanced_search_toggle.wait_for_and_click()
|
||||
self.components.histories.advanced_search_filter(filter="published").wait_for_and_click()
|
||||
self.components.histories.advanced_search_submit.wait_for_and_click()
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
self.assert_histories_in_grid([self.history2_name])
|
||||
@@ -134,22 +134,11 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
def test_standard_search(self):
|
||||
self._login()
|
||||
self.navigate_to_histories_page()
|
||||
|
||||
search_input = self.components.grids.free_text_search.wait_for_visible()
|
||||
search_input.send_keys(self.history2_name)
|
||||
self.send_enter(search_input)
|
||||
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
self.components.histories.search_input.wait_for_and_send_keys(self.history2_name)
|
||||
self.assert_grid_histories_are([self.history2_name])
|
||||
|
||||
self.unset_filter("free-text-search", self.history2_name)
|
||||
search_input = self.components.grids.free_text_search.wait_for_visible()
|
||||
search_input.send_keys(self.history4_name)
|
||||
self.send_enter(search_input)
|
||||
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
self.components.histories.reset_input.wait_for_and_click()
|
||||
self.components.histories.search_input.wait_for_and_send_keys(self.history4_name)
|
||||
self.assert_grid_histories_are([])
|
||||
|
||||
@selenium_test
|
||||
@@ -223,17 +212,6 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
def get_histories(self):
|
||||
return self.histories_get_history_names()
|
||||
|
||||
def set_filter(self, selector, value):
|
||||
filter_input = self.wait_for_selector_clickable(selector)
|
||||
filter_input.send_keys(value)
|
||||
self.send_enter(filter_input)
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
def unset_filter(self, filter_key, filter_value):
|
||||
close_button_selector = f'a[filter_key="{filter_key}"][filter_val="{filter_value}"]'
|
||||
self.wait_for_and_click_selector(close_button_selector)
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
|
||||
def setup_shared_state(self):
|
||||
TestSavedHistories.user_email = self._get_random_email()
|
||||
TestSavedHistories.history1_name = self._get_random_name()
|
||||
|
||||
Reference in New Issue
Block a user