Merge remote-tracking branch 'jmchilton/citations' into dev

This commit is contained in:
Dannon Baker
2017-11-30 15:09:56 -05:00
11 changed files with 69 additions and 28 deletions
+28
View File
@@ -1,6 +1,7 @@
from galaxy_selenium.navigates_galaxy import retry_call_during_transitions
from .framework import (
retry_assertion_during_transitions,
selenium_test,
SeleniumTestCase,
UsesHistoryItemAssertions,
@@ -105,6 +106,33 @@ class ToolFormTestCase(SeleniumTestCase, UsesHistoryItemAssertions):
assert latest_hda["hid"] == 3
assert latest_hda["name"] == "Select first on data 1"
@selenium_test
def test_bibtex_rendering(self):
self.home()
# prefetch citations so they will be available quickly when rendering tool form.
citations_api = self.api_get("tools/bibtex/citations")
assert len(citations_api) == 29, len(citations_api)
self.tool_open("bibtex")
self.components.tool_form.citations.wait_for_visible()
@retry_assertion_during_transitions
def assert_citations_visible():
references = self.components.tool_form.reference.all()
# This should be 29, but bugs I guess?
assert len(references) > 0, len(references)
return references
references = assert_citations_visible()
doi_resolved_citation = references[0]
assert "Galaxy: A platform for interactive" in doi_resolved_citation.text
self.screenshot("tool_form_citations_formatted")
self.components.tool_form.show_bibtex.wait_for_and_click()
textarea = self.components.tool_form.bibtex_area.wait_for_visible()
assert "Galaxy: A platform for interactive" in textarea.get_attribute("value")
self.screenshot("tool_form_citations_bibtex")
def _check_dataset_details_for_inttest_value(self, hid, expected_value="42"):
self.hda_click_primary_action_button(hid, "info")