Skip to content

Commit

Permalink
Add selenium tests for workflow landing
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 19, 2024
1 parent 6b738af commit e8ed4d5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ def home(self) -> None:
except SeleniumTimeoutException as e:
raise ClientBuildException(e)

def go_to_workflow_landing(self, uuid: str, public: bool, client_secret: Optional[str]):
path = f"workflow_landings/{uuid}?public={public}"
if client_secret:
path = f"{path}&client_secret={client_secret}"
self.driver.get(self.build_url(path))
self.components.workflow_run.run_workflow.wait_for_visible()

def go_to_trs_search(self) -> None:
self.driver.get(self.build_url("workflows/trs_search"))
self.components.masthead._.wait_for_visible()
Expand Down
60 changes: 60 additions & 0 deletions lib/galaxy_test/selenium/test_workflow_landing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from galaxy.schema.schema import CreateWorkflowLandingRequestPayload
from .framework import (
managed_history,
RunsWorkflows,
selenium_test,
SeleniumTestCase,
)


class TestWorkflowLanding(SeleniumTestCase, RunsWorkflows):
ensure_registered = True

@selenium_test
@managed_history
def test_private_request(self):
self._create_landing_and_run(public=False)

@selenium_test
@managed_history
def test_pubblic_request(self):
self._create_landing_and_run(public=True)

def _create_landing_and_run(self, public: bool):
self.perform_upload(self.get_filename("1.txt"))
self.wait_for_history()
workflow_id = self.workflow_upload_yaml_with_random_name(
"""
class: GalaxyWorkflow
inputs:
input_int: integer
input_data: data
steps:
simple_constructs:
tool_id: simple_constructs
label: tool_exec
in:
inttest: input_int
files_0|file: input_data
"""
)
if public:
client_secret = None
else:
client_secret = "abcdefg"
landing_request_payload = CreateWorkflowLandingRequestPayload(
workflow_id=workflow_id,
workflow_target_type="stored_workflow",
request_state={"input_int": 321123},
public=public,
client_secret=client_secret,
)
landing_request = self.dataset_populator.create_workflow_landing(landing_request_payload)
self.go_to_workflow_landing(str(landing_request.uuid), public=False, client_secret=client_secret)
self.screenshot("workflow_run_private_landing")
self.workflow_run_submit()
output_hid = 2
self.workflow_run_wait_for_ok(hid=output_hid)
history_id = self.current_history_id()
content = self.dataset_populator.get_history_dataset_content(history_id, hid=output_hid)
assert "321123" in content, content

0 comments on commit e8ed4d5

Please sign in to comment.