From 363ddf562ed09b8d9691e9f52f0c8e1804c40377 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 7 Mar 2025 09:10:09 -0500 Subject: [PATCH] Revise consistently failing edam tool panel view test. The tool panel view renders the default view before switching to the EDAM I think, so retrying the assertion instead of just retrying any DOM click failures should allow that to stabilize. The UI flicker seems to be a regression though - but this test didn't prevent that so now it has to test something else. Also I think the EDAM stuff is just on by default now so this doesn't need to be an integration test - as such moved it to the vanilla Selenium tests. --- lib/galaxy/selenium/navigates_galaxy.py | 8 ++++++++ .../selenium}/test_edam_tool_panel_views.py | 13 ++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) rename {test/integration_selenium => lib/galaxy_test/selenium}/test_edam_tool_panel_views.py (78%) diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index 15f12312385..290d1bb74d4 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -1695,6 +1695,14 @@ class NavigatesGalaxy(HasDriver): self.sleep_for(self.wait_types.UX_RENDER) + def swap_to_tool_panel(self, panel_id: str) -> None: + tool_panel = self.components.tool_panel + tool_panel.views_button.wait_for_and_click() + tool_panel.views_menu_item(panel_id=panel_id).wait_for_and_click() + + def swap_to_tool_panel_edam_operations(self) -> None: + self.swap_to_tool_panel("ontology:edam_operations") + def tool_open(self, tool_id, outer=False): self.open_toolbox() diff --git a/test/integration_selenium/test_edam_tool_panel_views.py b/lib/galaxy_test/selenium/test_edam_tool_panel_views.py similarity index 78% rename from test/integration_selenium/test_edam_tool_panel_views.py rename to lib/galaxy_test/selenium/test_edam_tool_panel_views.py index 2e3d143cb55..e1c26c0fcf5 100644 --- a/test/integration_selenium/test_edam_tool_panel_views.py +++ b/lib/galaxy_test/selenium/test_edam_tool_panel_views.py @@ -1,22 +1,21 @@ -from galaxy.selenium.navigates_galaxy import retry_during_transitions from .framework import ( + retry_assertion_during_transitions, selenium_test, - SeleniumIntegrationTestCase, + SeleniumTestCase, ) -class TestEdamToolPanelViewsSeleniumIntegration(SeleniumIntegrationTestCase): +class TestEdamToolPanelViewsSelenium(SeleniumTestCase): ensure_registered = True # to test workflow editor @selenium_test def test_basic_navigation(self): - tool_panel = self.components.tool_panel - tool_panel.views_button.wait_for_and_click() - tool_panel.views_menu_item(panel_id="ontology:edam_operations").wait_for_and_click() + self.swap_to_tool_panel_edam_operations() self._assert_displaying_edam_operations() # reload page and ensure the edam operations are still being displayed. self.home() + tool_panel = self.components.tool_panel tool_panel.views_button.wait_for_visible() self._assert_displaying_edam_operations() self.screenshot("tool_panel_view_edam_landing") @@ -31,7 +30,7 @@ class TestEdamToolPanelViewsSeleniumIntegration(SeleniumIntegrationTestCase): self._assert_displaying_edam_operations() self.screenshot("tool_panel_view_edam_workflow_editor") - @retry_during_transitions + @retry_assertion_during_transitions def _assert_displaying_edam_operations(self): tool_panel = self.components.tool_panel tool_panel.toolbox.wait_for_visible()