Skip to content

Commit 21d90a0

Browse files
committed
Add selenium test to check display component
1 parent 506bb3d commit 21d90a0

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

client/src/components/Dataset/DatasetDisplay.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ watch(
7575
{{ errorMessage }}
7676
</BAlert>
7777
<LoadingSpan v-else-if="isLoading || !dataset" message="Loading dataset content" />
78-
<div v-else class="h-100">
78+
<div v-else class="dataset-display h-100">
7979
<Alert v-if="sanitizedMessage" :dismissible="true" variant="warning" data-description="sanitization warning">
8080
{{ sanitizedMessage }}
8181
<span v-if="isAdmin && sanitizedToolId">
@@ -99,7 +99,7 @@ watch(
9999
</div>
100100
<a :href="downloadUrl">Download</a>
101101
</div>
102-
<CenterFrame :src="previewUrl" @load="emit('load')" />
102+
<CenterFrame id="galaxy_dataset" :src="previewUrl" @load="emit('load')" />
103103
</div>
104104
</div>
105105
</template>

client/src/utils/navigation/navigation.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ dataset_view:
165165
details_tab: ".nav-item[title='View detailed information about this dataset'] > a.nav-link"
166166
visualize_tab: ".nav-item[title='Explore available visualizations for this dataset'] > a.nav-link"
167167

168+
dataset_display:
169+
selectors:
170+
container: .dataset-display
171+
content: body
172+
168173
history_panel:
169174
menu:
170175
labels:

lib/galaxy/selenium/navigates_galaxy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
RETRY_DURING_TRANSITIONS_ATTEMPTS_DEFAULT = 10
6363

6464
GALAXY_MAIN_FRAME_ID = "galaxy_main"
65+
GALAXY_DATASET_FRAME_ID = "galaxy_dataset"
6566
GALAXY_VISUALIZATION_FRAME_ID = "galaxy_visualization"
6667

6768
WaitType = collections.namedtuple("WaitType", ["name", "default_length"])
@@ -388,6 +389,9 @@ def go_to_import_zip(self) -> None:
388389
def switch_to_main_panel(self):
389390
self.switch_to_frame(GALAXY_MAIN_FRAME_ID)
390391

392+
def switch_to_dataset_panel(self):
393+
self.driver.switch_to.frame(GALAXY_DATASET_FRAME_ID)
394+
391395
@contextlib.contextmanager
392396
def local_storage(self, key: str, value: Union[float, str]):
393397
"""Method decorator to modify localStorage for the scope of the supplied context."""

lib/galaxy_test/selenium/test_dataset_edit.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
2+
from selenium.webdriver.common.by import By
3+
14
from galaxy.selenium.axe_results import FORMS_VIOLATIONS
5+
26
from .framework import (
37
managed_history,
48
selenium_only,
@@ -13,6 +17,24 @@
1317
class TestHistoryPanel(SeleniumTestCase):
1418
ensure_registered = True
1519

20+
@selenium_test
21+
@managed_history
22+
def test_history_dataset_display_text(self):
23+
original_name = "1.txt"
24+
25+
history_entry = self.perform_single_upload(self.get_filename(original_name))
26+
hid = history_entry.hid
27+
self.wait_for_history()
28+
self.history_panel_wait_for_hid_ok(hid)
29+
self.display_dataset(hid=hid)
30+
31+
dataset_display = self.components.dataset_display.container
32+
dataset_display.wait_for_visible()
33+
34+
self.switch_to_dataset_panel()
35+
text = self.components.dataset_display.content.wait_for_text()
36+
assert "chr1 4225 19670" in text
37+
1638
@selenium_test
1739
@managed_history
1840
def test_history_dataset_rename(self):

0 commit comments

Comments
 (0)