Unverified Commit ada51b2a authored by davelopez's avatar davelopez
Browse files

Add selenium test

For display job details on failed collections
parent 0b2cc4f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
<template>
    <div>
        <job-details-provider auto-refresh :jobId="job_id" @update:result="updateJob" />
        <job-details-provider auto-refresh :job-id="job_id" @update:result="updateJob" />
        <h3>Job Information</h3>
        <table id="job-information" class="tabletip info_data_table">
            <tbody>
@@ -46,7 +46,7 @@
                    :code-item="job.traceback" />
                <tr v-if="job">
                    <td>Tool Exit Code:</td>
                    <td id="exist-code">{{ job.exit_code }}</td>
                    <td id="exit-code">{{ job.exit_code }}</td>
                </tr>
                <tr v-if="job && job.job_messages && job.job_messages.length > 0" id="job-messages">
                    <td>Job Messages</td>
+6 −0
Original line number Diff line number Diff line
@@ -945,3 +945,9 @@ charts:
  selectors:
    visualize_button: '.ui-portlet .button i.fa-line-chart'  # without icon - it waits on other buttons that aren't visible, need more specific class
    viewport_canvas: 'svg.charts-viewport-canvas'

job_details:
  selectors:
    galaxy_tool_id: '#galaxy-tool-id'
    tool_exit_code: '#exit-code'
+25 −7
Original line number Diff line number Diff line
@@ -134,18 +134,23 @@ class HistoryPanelCollectionsTestCase(SeleniumTestCase):

    @selenium_test
    def test_collection_job_details(self):
        input_collection, failed_collection = self._generate_partially_failed_collection_with_input()
        ok_hid = input_collection["hid"]
        failed_hid = failed_collection["hid"]
        self.home()

        ok_collection_element = self.history_panel_wait_for_hid_state(ok_hid, "ok")
        failed_collection_element = self.history_panel_wait_for_hid_state(failed_hid, "error")
        ok_collection_hid, failed_collection_hid = self._generate_ok_and_failed_collections()
        ok_collection_element = self.history_panel_wait_for_hid_state(ok_collection_hid, "ok")
        failed_collection_element = self.history_panel_wait_for_hid_state(failed_collection_hid, "error")

        ok_collection_element.collection_job_details_button.wait_for_and_click()
        tool_id_component = self.components.job_details.galaxy_tool_id.wait_for_visible()
        tool_exit_code_component = self.components.job_details.tool_exit_code.wait_for_visible()
        self.screenshot("history_panel_collections_job_details_ok")
        assert tool_id_component.text == "collection_creates_list"
        assert int(tool_exit_code_component.text) == 0

        failed_collection_element.collection_job_details_button.wait_for_and_click()
        tool_id_component = self.components.job_details.galaxy_tool_id.wait_for_visible()
        tool_exit_code_component = self.components.job_details.tool_exit_code.wait_for_visible()
        self.screenshot("history_panel_collections_job_details_failed")
        assert tool_id_component.text == "collection_creates_list_fail"
        assert int(tool_exit_code_component.text) > 0

    @selenium_test
    def test_back_to_history_button(self):
@@ -317,3 +322,16 @@ class HistoryPanelCollectionsTestCase(SeleniumTestCase):
        self.history_panel_wait_for_hid_state(collection_hid, "ok")

        return input_collection

    def _generate_ok_and_failed_collections(self):
        history_id = self.current_history_id()
        fetch_response = self.dataset_collection_populator.create_list_in_history(
            history_id, contents=["0", "1", "0", "1"]
        ).json()
        hdca_id = self.dataset_collection_populator.wait_for_fetched_collection(fetch_response)["id"]
        collection_input = {"input1": {"src": "hdca", "id": hdca_id}}
        ok_response = self.dataset_populator.run_tool("collection_creates_list", collection_input, history_id)
        failed_response = self.dataset_populator.run_tool("collection_creates_list_fail", collection_input, history_id)
        ok_collection_hid = ok_response["output_collections"][0]["hid"]
        failed_collection_hid = failed_response["output_collections"][0]["hid"]
        return ok_collection_hid, failed_collection_hid