Merge pull request #13504 from jmchilton/export_test_sele

Integration end-to-end test for PDF export.
This commit is contained in:
David López
2022-03-09 18:12:07 +01:00
committed by GitHub
6 changed files with 65 additions and 23 deletions
@@ -16,6 +16,7 @@ env:
GALAXY_TEST_SELENIUM_RETRIES: 1
YARN_INSTALL_OPTS: --frozen-lockfile
GALAXY_CONFIG_SQLALCHEMY_WARN_20: '1'
GALAXY_DEPENDENCIES_INSTALL_WEASYPRINT: '1'
concurrency:
group: integration-selenium-${{ github.ref }}
cancel-in-progress: true
+2 -2
View File
@@ -5,7 +5,7 @@
<div>
<b-button
v-if="effectiveExportLink"
class="float-right"
class="float-right markdown-pdf-export"
title="Download PDF"
variant="link"
role="button"
@@ -15,7 +15,7 @@
</b-button>
<b-button
v-if="!readOnly"
class="float-right"
class="float-right markdown-edit"
title="Edit Markdown"
variant="link"
role="button"
+26
View File
@@ -1012,6 +1012,11 @@ class NavigatesGalaxy(HasDriver):
self.click_masthead_user()
self.components.masthead.invocations.wait_for_and_click()
def navigate_to_pages(self):
self.home()
self.click_masthead_user()
self.components.masthead.pages.wait_for_and_click()
def admin_open(self):
self.components.masthead.admin.wait_for_and_click()
@@ -1265,6 +1270,27 @@ class NavigatesGalaxy(HasDriver):
self.driver.execute_script("arguments[0].scrollIntoView(true);", tool_element)
tool_link.wait_for_and_click()
def create_page_and_edit(self, name=None, slug=None, content_format=None, screenshot_name=None):
name = self.create_page(name=name, slug=slug, content_format=content_format, screenshot_name=screenshot_name)
self.click_grid_popup_option(name, "Edit content")
self.components.pages.editor.wym_iframe.wait_for_visible()
return name
def create_page(self, name=None, slug=None, content_format=None, screenshot_name=None):
self.components.pages.create.wait_for_and_click()
name = name or self._get_random_name(prefix="page")
slug = slug = self._get_random_name(prefix="pageslug")
content_format = content_format or "HTML"
self.tool_set_value("title", name)
self.tool_set_value("slug", slug)
self.tool_set_value("content_format", content_format, expected_type="select")
if screenshot_name:
self.screenshot(screenshot_name)
# Sometimes 'submit' button not yet hooked up?
self.sleep_for(self.wait_types.UX_RENDER)
self.components.pages.submit.wait_for_and_click()
return name
def tool_parameter_div(self, expanded_parameter_id):
return self.components.tool_form.parameter_div(parameter=expanded_parameter_id).wait_for_clickable()
+2 -1
View File
@@ -442,6 +442,7 @@ pages:
selectors:
create: '.manage-table-actions .action-button'
submit: '#submit'
export: '.markdown-pdf-export'
editor:
selectors:
wym_iframe: 'div.wym_iframe iframe'
@@ -450,7 +451,7 @@ pages:
embed_button: '#embed-galaxy-object'
dataset_selector: '.saved-datasets'
embed_dialog_add_button: '.pages-embed .buttons #button-0'
markdown_editor: '.markdown-textarea'
labels:
embed_dataset: 'Embed Dataset'
+1 -20
View File
@@ -18,22 +18,7 @@ class PagesTestCase(SeleniumTestCase):
self.history_panel_wait_for_hid_ok(1)
self.navigate_to_pages()
self.screenshot("pages_grid")
self.components.pages.create.wait_for_and_click()
name = self._get_random_name(prefix="page")
slug = self._get_random_name(prefix="pageslug")
self.tool_set_value("title", name)
self.tool_set_value("slug", slug)
self.tool_set_value("content_format", "HTML", expected_type="select")
self.screenshot("pages_create_form")
# Sometimes 'submit' button not yet hooked up?
self.sleep_for(self.wait_types.UX_RENDER)
self.components.pages.submit.wait_for_and_click()
self.click_grid_popup_option(name, "Edit content")
self.components.pages.editor.wym_iframe.wait_for_visible()
name = self.create_page_and_edit(screenshot_name="pages_create_form")
self.screenshot("pages_editor_new")
self.driver.switch_to.frame(0)
try:
@@ -58,7 +43,3 @@ class PagesTestCase(SeleniumTestCase):
self.navigate_to_pages()
self.click_grid_popup_option(name, "View")
self.screenshot("pages_view_simple")
def navigate_to_pages(self):
self.click_masthead_user() # Open masthead menu
self.components.masthead.pages.wait_for_and_click()
@@ -0,0 +1,33 @@
from .framework import (
selenium_test,
SeleniumIntegrationTestCase,
)
class PagesPdfExportSeleniumIntegrationTestCase(SeleniumIntegrationTestCase):
ensure_registered = True
@classmethod
def handle_galaxy_config_kwds(cls, config):
config["enable_beta_markdown_export"] = True
@selenium_test
def test_page_pdf_export(self):
self.navigate_to_pages()
self.screenshot("pages_grid")
name = self.create_page(
content_format="Markdown",
)
self.click_grid_popup_option(name, "Edit content")
self.components.pages.editor.markdown_editor.wait_for_and_send_keys("moo\n\n\ncow\n\n")
self.screenshot("pages_markdown_editor")
self.sleep_for(self.wait_types.UX_RENDER)
self.screenshot("pages_markdown_editor_content")
self.components.pages.editor.save.wait_for_and_click()
self.screenshot("pages_markdown_editor_saved")
self.sleep_for(self.wait_types.UX_RENDER)
self.navigate_to_pages()
self.click_grid_popup_option(name, "View")
self.screenshot("pages_view_simple")
self.components.pages.export.wait_for_and_click()
self.sleep_for(self.wait_types.UX_RENDER)