Skip to content

Commit

Permalink
Adjust visualization test case, validate against visualization frame
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Apr 23, 2024
1 parent 54cbc64 commit 17d0703
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const srcWithRoot = computed(() => {

<template>
<iframe
id="galaxy_visualization"
:src="srcWithRoot"
class="center-frame"
frameborder="0"
Expand Down
10 changes: 10 additions & 0 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
RETRY_DURING_TRANSITIONS_ATTEMPTS_DEFAULT = 10

GALAXY_MAIN_FRAME_ID = "galaxy_main"
GALAXY_VISUALIZATION_FRAME_ID = "galaxy_visualization"

WaitType = collections.namedtuple("WaitType", ["name", "default_length"])

Expand Down Expand Up @@ -298,6 +299,15 @@ def main_panel(self):
finally:
self.driver.switch_to.default_content()

@contextlib.contextmanager
def visualization_panel(self):
"""Decorator to operate within the context of Galaxy's visualization frame."""
try:
self.driver.switch_to.frame(GALAXY_VISUALIZATION_FRAME_ID)
yield
finally:
self.driver.switch_to.default_content()

def api_get(self, endpoint, data=None, raw=False):
data = data or {}
full_url = self.build_url(f"api/{endpoint}", for_selenium=False)
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy_test/selenium/test_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_charts_image_annotate(self):
self.screenshot("visualization_plugins_png")
self.components.visualization.plugin_item(id="annotate_image").wait_for_and_click()

with self.main_panel():
with self.visualization_panel():
self.wait_for_selector("#image-annotate")
self.screenshot("visualization_plugin_charts_image_annotate")

Expand All @@ -44,6 +44,6 @@ def test_charts_nvd3_bar(self):
self.screenshot("visualization_plugins_sam")
self.components.visualization.plugin_item(id="nvd3_bar").wait_for_and_click()

with self.main_panel():
with self.visualization_panel():
self.wait_for_selector("g.nvd3")
self.screenshot("visualization_plugin_charts_nvd3_bar_landing")

0 comments on commit 17d0703

Please sign in to comment.