Skip to content

Commit 3e3d9ff

Browse files
authored
Merge pull request #21039 from jmchilton/25_1_selenium_2
Selenium test for the new storage delete confirm dialog.
2 parents d1625f9 + a94fb92 commit 3e3d9ff

File tree

5 files changed

+46
-3
lines changed

5 files changed

+46
-3
lines changed

client/src/components/User/DiskUsage/Visualizations/Charts/BarChart.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ function drawChart() {
151151
.attr("y", (d) => yScale(d.value) - xAxisHeight)
152152
.attr("width", xScale.bandwidth())
153153
.attr("height", (d) => chartHeight - yScale(d.value))
154-
.attr("fill", (d) => entryColor(d));
154+
.attr("fill", (d) => entryColor(d))
155+
.attr("data-label", (d) => d.label);
155156
156157
return bars;
157158
}

client/src/components/User/DiskUsage/Visualizations/HistoryStorageOverview.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function onUndelete(datasetId: string) {
142142
<div v-else>
143143
<BarChart
144144
v-if="topNDatasetsBySizeData"
145+
data-description="chart history top datasets by size"
145146
:description="
146147
localize(
147148
`These are the ${numberOfDatasetsToDisplay} datasets that take the most space in this history. Click on a bar to see more information about the dataset.`,
@@ -223,6 +224,7 @@ function onUndelete(datasetId: string) {
223224

224225
<BarChart
225226
v-if="activeVsDeletedTotalSizeData"
227+
data-description="chart history datasets by active"
226228
:title="localize('Active vs Deleted Total Size')"
227229
:description="
228230
localize(

client/src/components/User/DiskUsage/Visualizations/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export function useDatasetsToDisplay() {
6161
okVariant: "danger",
6262
okTitle: localize("Permanently delete"),
6363
cancelTitle: localize("Cancel"),
64+
dialogClass: "confirm-delete-dataset-dialog",
6465
},
6566
);
6667
if (!confirmed) {

client/src/utils/navigation/navigation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ history_panel:
356356
history_storage:
357357
selectors:
358358
_: '.history-storage-overview'
359+
top_datasets_by_size: "[data-description='chart history top datasets by size']"
360+
dataset_by_size: "[data-description='chart history top datasets by size'] rect[data-label='${name}']"
361+
dataset_by_size_delete: '#g-card-action-delete-selected-item-actions-dataset'
362+
confirm_delete: '.confirm-delete-dataset-dialog .btn-danger'
359363

360364
storage_dashboard:
361365
selectors:

lib/galaxy_test/selenium/test_history_storage.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
"bytes12": "moocow1235",
2020
}
2121

22+
UPLOAD_DATA_3 = {
23+
"small": "a",
24+
"medium": "aaaaa",
25+
"big": "aaaaaaaaaa",
26+
}
27+
2228

23-
class TestHistorySharing(SeleniumTestCase):
29+
class TestHistoryStorage(SeleniumTestCase):
2430
ensure_registered = True
2531

2632
@selenium_test
2733
@managed_history
28-
def test_history_storage(self):
34+
def test_history_storage_accessibility(self):
2935
self.perform_upload_of_pasted_content(UPLOAD_DATA)
3036
self.history_panel_wait_for_hid_visible(11)
3137
self.wait_for_history()
@@ -34,6 +40,8 @@ def test_history_storage(self):
3440
self.screenshot("history_storage")
3541
self.components.history_storage._.assert_no_axe_violations_with_impact_of_at_least("critical")
3642

43+
# this is testing the global storage dashboard for the user - should be separated out
44+
# but I think it stuck them together so there is an existing history with data.
3745
self.home()
3846
self.components.masthead.storage_dashboard_link.wait_for_and_click()
3947
self.screenshot("storage_dashboard")
@@ -46,3 +54,30 @@ def test_history_storage(self):
4654
self.components.storage_dashboard.explore_usage_link.wait_for_and_click()
4755
self.screenshot("storage_dashboard_manage_explore_usage_landing")
4856
self.assert_baseline_accessibility()
57+
58+
@selenium_test
59+
@managed_history
60+
def test_delete_dataset_from_storage_view(self):
61+
"""Test deleting a dataset from the history storage overview."""
62+
# Upload test data with different sizes
63+
self.perform_upload_of_pasted_content(UPLOAD_DATA_3)
64+
self.wait_for_history()
65+
66+
# Navigate to history storage overview
67+
self.home()
68+
self.components.history_panel.storage_overview.wait_for_and_click()
69+
self.components.history_storage._.wait_for_visible()
70+
self.components.history_storage.top_datasets_by_size.wait_for_visible()
71+
72+
# Click on the largest dataset
73+
self.components.history_storage.dataset_by_size(name="big").wait_for_and_click()
74+
self.screenshot("history_storage_active_dataset")
75+
76+
# Delete the dataset
77+
self.components.history_storage.dataset_by_size_delete.wait_for_and_click()
78+
self.screenshot("history_storage_confirm_delete")
79+
self.components.history_storage.confirm_delete.wait_for_and_click()
80+
81+
# Verify dataset is removed from storage view
82+
self.components.history_storage.dataset_by_size(name="big").wait_for_absent()
83+
self.screenshot("history_storage_post_delete")

0 commit comments

Comments
 (0)