mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Add multiple history delete and undelete test case
This commit is contained in:
@@ -363,7 +363,7 @@ watch(operationMessage, () => {
|
||||
class="mr-2"
|
||||
size="sm"
|
||||
variant="primary"
|
||||
:data-description="`grid action ${batchOperation.title.toLowerCase()}`"
|
||||
:data-description="`grid batch ${batchOperation.title.toLowerCase()}`"
|
||||
@click="onBatchOperation(batchOperation, Array.from(selected))">
|
||||
<Icon :icon="batchOperation.icon" class="mr-1" />
|
||||
<span v-localize>{{ batchOperation.title }} ({{ selected.size }})</span>
|
||||
|
||||
@@ -576,6 +576,16 @@ class NavigatesGalaxy(HasDriver):
|
||||
|
||||
return cell
|
||||
|
||||
def check_grid_rows(self, grid_name, item_names):
|
||||
grid = self.wait_for_selector(grid_name)
|
||||
for row in grid.find_elements(By.TAG_NAME, "tr"):
|
||||
td = row.find_elements(By.TAG_NAME, "td")
|
||||
item_name = td[1].text
|
||||
if item_name in item_names:
|
||||
checkbox = td[0].find_element(self.by.TAG_NAME, "input")
|
||||
# bootstrap vue checkbox seems to be hidden by label, but the label is not interactable
|
||||
self.driver.execute_script("$(arguments[0]).click();", checkbox)
|
||||
|
||||
def published_grid_search_for(self, search_term=None):
|
||||
return self._inline_search_for(
|
||||
self.navigation.grids.free_text_search,
|
||||
|
||||
@@ -119,6 +119,40 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
|
||||
self.assert_histories_in_grid([self.history4_name])
|
||||
|
||||
@selenium_test
|
||||
def test_delete_and_undelete_multiple_histories(self):
|
||||
self._login()
|
||||
self.navigate_to_histories_page()
|
||||
|
||||
delete_button_selector = 'button[data-description="grid batch delete"]'
|
||||
undelete_button_selector = 'button[data-description="grid batch restore"]'
|
||||
|
||||
# Select multiple histories
|
||||
self.check_grid_rows("#histories-grid", [self.history2_name, self.history3_name])
|
||||
|
||||
# Delete multiple histories
|
||||
self.wait_for_and_click_selector(delete_button_selector)
|
||||
alert = self.driver.switch_to.alert
|
||||
alert.accept()
|
||||
|
||||
# Display deleted histories
|
||||
self.components.histories.advanced_search_toggle.wait_for_and_click()
|
||||
self.components.histories.advanced_search_filter(filter="deleted").wait_for_and_click()
|
||||
self.components.histories.advanced_search_submit.wait_for_and_click()
|
||||
|
||||
# Select multiple histories
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
self.check_grid_rows("#histories-grid", [self.history2_name, self.history3_name])
|
||||
|
||||
# Undelete multiple histories
|
||||
self.wait_for_and_click_selector(undelete_button_selector)
|
||||
alert = self.driver.switch_to.alert
|
||||
alert.accept()
|
||||
|
||||
# Verify deleted histories have been undeleted
|
||||
self.components.histories.reset_input.wait_for_and_click()
|
||||
self.assert_histories_in_grid([self.history2_name, self.history3_name])
|
||||
|
||||
@selenium_test
|
||||
def test_sort_by_name(self):
|
||||
self._login()
|
||||
@@ -141,7 +175,6 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
def test_standard_search(self):
|
||||
self._login()
|
||||
self.navigate_to_histories_page()
|
||||
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.components.histories.reset_input.wait_for_and_click()
|
||||
@@ -152,7 +185,6 @@ class TestSavedHistories(SharedStateSeleniumTestCase):
|
||||
def test_advanced_search(self):
|
||||
self._login()
|
||||
self.navigate_to_histories_page()
|
||||
self.sleep_for(self.wait_types.UX_RENDER)
|
||||
# search by name
|
||||
self.components.histories.advanced_search_toggle.wait_for_and_click()
|
||||
self.components.histories.advanced_search_name_input.wait_for_and_send_keys(self.history3_name)
|
||||
|
||||
Reference in New Issue
Block a user