diff --git a/lib/galaxy/selenium/context.py b/lib/galaxy/selenium/context.py index 9119269427b..e961eade0ec 100644 --- a/lib/galaxy/selenium/context.py +++ b/lib/galaxy/selenium/context.py @@ -1,4 +1,5 @@ from typing import Optional + from six.moves.urllib.parse import urljoin from .driver_factory import ConfiguredDriver @@ -35,7 +36,11 @@ class GalaxySeleniumContext(NavigatesGalaxy): class GalaxySeleniumContextImpl(GalaxySeleniumContext): - """Minimal, simplified GalaxySeleniumContext useful outside the context of test cases.""" + """Minimal, simplified GalaxySeleniumContext useful outside the context of test cases. + + A variant of this concept that can also populate content via the API + to then interact with via the Selenium is :class:galaxy_test.selenium.framework:`GalaxySeleniumContextImpl`. + """ def __init__(self, from_dict: Optional[dict] = None) -> None: from_dict = from_dict or {} diff --git a/lib/galaxy_test/selenium/framework.py b/lib/galaxy_test/selenium/framework.py index aec14bc2295..043e6a4b07f 100644 --- a/lib/galaxy_test/selenium/framework.py +++ b/lib/galaxy_test/selenium/framework.py @@ -185,7 +185,26 @@ class TestSnapshot: write_file_func("%s-stack.txt" % prefix, str(self.stack)) -class TestWithSeleniumMixin(GalaxySeleniumContext, UsesApiTestCaseMixin): +class GalaxyTestSeleniumContext(GalaxySeleniumContext): + """Extend GalaxySeleniumContext with Selenium-aware galaxy_test.base.populators.""" + + @property + def dataset_populator(self) -> populators.BaseDatasetPopulator: + """A dataset populator connected to the Galaxy session described by Selenium context.""" + return SeleniumSessionDatasetPopulator(self) + + @property + def dataset_collection_populator(self) -> populators.BaseDatasetCollectionPopulator: + """A dataset collection populator connected to the Galaxy session described by Selenium context.""" + return SeleniumSessionDatasetCollectionPopulator(self) + + @property + def workflow_populator(self) -> populators.BaseWorkflowPopulator: + """A workflow populator connected to the Galaxy session described by Selenium context.""" + return SeleniumSessionWorkflowPopulator(self) + + +class TestWithSeleniumMixin(GalaxyTestSeleniumContext, UsesApiTestCaseMixin): # If run one-off via nosetests, the next line ensures test # tools and datatypes are used instead of configured tools. framework_tool_and_types = True @@ -355,18 +374,6 @@ class TestWithSeleniumMixin(GalaxySeleniumContext, UsesApiTestCaseMixin): with self.main_panel(): self.assert_no_error_message() - @property - def dataset_populator(self): - return SeleniumSessionDatasetPopulator(self) - - @property - def dataset_collection_populator(self): - return SeleniumSessionDatasetCollectionPopulator(self) - - @property - def workflow_populator(self): - return SeleniumSessionWorkflowPopulator(self) - def workflow_upload_yaml_with_random_name(self, content, **kwds): workflow_populator = self.workflow_populator name = self._get_random_name()