From cb9cbfe796ecf4e5f077c6a4e0ebe97d0102c3b5 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 20 Sep 2018 09:07:15 -0400 Subject: [PATCH] Fix tour tests. --- .../galaxy/scripts/mvc/tool/tool-form-base.js | 1 + config/plugins/tours/core.galaxy_ui.yaml | 6 +-- test/galaxy_selenium/navigates_galaxy.py | 11 +++-- test/selenium_tests/test_stock_tours.py | 42 ++++++++----------- 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/client/galaxy/scripts/mvc/tool/tool-form-base.js b/client/galaxy/scripts/mvc/tool/tool-form-base.js index 97ca2c5e148..b66c6c53f1f 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form-base.js +++ b/client/galaxy/scripts/mvc/tool/tool-form-base.js @@ -252,6 +252,7 @@ export default FormBase.extend({ /** Templates */ _templateHelp: function(options) { var $tmpl = $("
") + .addClass("form-help") .addClass("form-text") .append(options.help); $tmpl.find("a").attr("target", "_blank"); diff --git a/config/plugins/tours/core.galaxy_ui.yaml b/config/plugins/tours/core.galaxy_ui.yaml index 474eff8bf07..35ce3b9b9f8 100644 --- a/config/plugins/tours/core.galaxy_ui.yaml +++ b/config/plugins/tours/core.galaxy_ui.yaml @@ -89,19 +89,19 @@ steps: - 'a[href$="tool_runner?tool_id=Filter1"]' - title: "Filter Tool" - element: '#center-panel' + element: '.center-panel' intro: "Your tool is loaded into the main Galaxy page and ready for use." position: "right" #backdropContainer: 'background' #backdrop: true - title: "Tool parameters" - element: '#center-panel .ui-portlet-limited' + element: '.center-panel .ui-portlet' intro: "Here you can choose your tool parameters. Select your input dataset from your history and specify parameters for your analysis." position: "right" - title: "Tool help" - element: 'div.ui-form-help' + element: 'div.form-help' intro: "Every Galaxy tool has a help section with detailed information about the tool and its parameters. Have a look and study your tool in depth by reading it." position: "top" diff --git a/test/galaxy_selenium/navigates_galaxy.py b/test/galaxy_selenium/navigates_galaxy.py index 77fc4014886..b4d352f1281 100644 --- a/test/galaxy_selenium/navigates_galaxy.py +++ b/test/galaxy_selenium/navigates_galaxy.py @@ -1370,8 +1370,7 @@ class NavigatesGalaxy(HasDriver): preclick = step.get("preclick", []) for preclick_selector in preclick: print("(Pre)Clicking %s" % preclick_selector) - element = self.tour_wait_for_clickable_element(preclick_selector) - element.click() + self._tour_wait_for_and_click_element(preclick_selector) element_str = step.get("element", None) if element_str is not None: @@ -1388,8 +1387,12 @@ class NavigatesGalaxy(HasDriver): postclick = step.get("postclick", []) for postclick_selector in postclick: print("(Post)Clicking %s" % postclick_selector) - element = self.tour_wait_for_clickable_element(postclick_selector) - element.click() + self._tour_wait_for_and_click_element(postclick_selector) + + @retry_during_transitions + def _tour_wait_for_and_click_element(self, selector): + element = self.tour_wait_for_clickable_element(selector) + element.click() @retry_during_transitions def wait_for_and_click_selector(self, selector): diff --git a/test/selenium_tests/test_stock_tours.py b/test/selenium_tests/test_stock_tours.py index f8954913100..047eec80c70 100644 --- a/test/selenium_tests/test_stock_tours.py +++ b/test/selenium_tests/test_stock_tours.py @@ -3,7 +3,8 @@ import os from galaxy.util import galaxy_root_path from .framework import ( selenium_test, - SeleniumTestCase + SeleniumTestCase, + TIMEOUT_MULTIPLIER, ) STOCK_TOURS_DIRECTORY = os.path.join(galaxy_root_path, "config", "plugins", "tours") @@ -11,30 +12,23 @@ STOCK_TOURS_DIRECTORY = os.path.join(galaxy_root_path, "config", "plugins", "tou class TestStockToursTestCase(SeleniumTestCase): - # Test doesn't pass consistently on Jenkins yet, something is wrong is tool panel - # interactions. Example problems: - # - https://jenkins.galaxyproject.org/view/All/job/selenium/86/testReport/junit/selenium_tests.test_stock_tours/TestStockToursTestCase/test_core_galaxy_ui/ - # - https://jenkins.galaxyproject.org/view/All/job/selenium/83/testReport/junit/selenium_tests.test_stock_tours/TestStockToursTestCase/test_core_galaxy_ui/ - # - https://jenkins.galaxyproject.org/view/All/job/selenium/81/testReport/junit/selenium_tests.test_stock_tours/TestStockToursTestCase/test_core_galaxy_ui/ - # I'd think that just pausing a bit between transitions to allow the tool panel to - # settle would fix it but it doesn't seem to in my initial testing. -John - # Tracking with https://github.com/galaxyproject/galaxy/issues/3598 - # @selenium_test - # def test_core_galaxy_ui(self): - # sleep_on_steps = { - # "Tools": 20, # Give upload a chance to take so tool form is filled in. - # "History": 20, - # } - # self.run_tour( - # os.path.join(STOCK_TOURS_DIRECTORY, "core.galaxy_ui.yaml"), - # sleep_on_steps=sleep_on_steps, - # ) + @selenium_test + def test_core_galaxy_ui(self): + sleep_on_steps = { + "Tools": 20 * TIMEOUT_MULTIPLIER, + "Select a tool": 2 * TIMEOUT_MULTIPLIER, + "History": 20 * TIMEOUT_MULTIPLIER, + } + self.run_tour( + os.path.join(STOCK_TOURS_DIRECTORY, "core.galaxy_ui.yaml"), + sleep_on_steps=sleep_on_steps + ) - # @selenium_test - # def test_core_scratchbook(self): - # self.run_tour( - # os.path.join(STOCK_TOURS_DIRECTORY, "core.scratchbook.yaml"), - # ) + @selenium_test + def test_core_scratchbook(self): + self.run_tour( + os.path.join(STOCK_TOURS_DIRECTORY, "core.scratchbook.yaml"), + ) @selenium_test def test_core_history(self):