diff options
Diffstat (limited to '3rd_party/static/onap-ui/components/results-report')
3 files changed, 64 insertions, 18 deletions
diff --git a/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html b/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html index 3f3e9c9..20295ab 100644 --- a/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html +++ b/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html @@ -1,4 +1,13 @@ <!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + +<!-- HTML for each accordion group that separates the status types on the results report page. --> diff --git a/3rd_party/static/onap-ui/components/results-report/resultsReport.html b/3rd_party/static/onap-ui/components/results-report/resultsReport.html index 38e602d..236ebfd 100644 --- a/3rd_party/static/onap-ui/components/results-report/resultsReport.html +++ b/3rd_party/static/onap-ui/components/results-report/resultsReport.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>Test Run Results</h3> @@ -15,8 +24,6 @@ <strong>Total: {{ctrl.statistics.total}}, Pass: {{ ctrl.statistics.pass}}, Rate: {{ ctrl.statistics.pass / ctrl.statistics.total * 100 | number:2 }}%</strong><br> <strong>Mandatory Total: {{ctrl.statistics.mandatory.total}}, Pass: {{ ctrl.statistics.mandatory.pass }}, Rate: {{ ctrl.statistics.mandatory.pass / ctrl.statistics.mandatory.total * 100 | number:2 }}%</strong><br> <strong>Optional Total: {{ctrl.statistics.optional.total}}, Pass: {{ ctrl.statistics.optional.pass }}, Rate: {{ ctrl.statistics.optional.pass / ctrl.statistics.optional.total * 100 | number:2 }}%</strong><br> - <hr> - <strong>{{ ctrl.validation }}</strong><br> <div> <hr> diff --git a/3rd_party/static/onap-ui/components/results-report/resultsReportController.js b/3rd_party/static/onap-ui/components/results-report/resultsReportController.js index 09601ad..1997c3d 100644 --- a/3rd_party/static/onap-ui/components/results-report/resultsReportController.js +++ b/3rd_party/static/onap-ui/components/results-report/resultsReportController.js @@ -78,24 +78,54 @@ } function gotoResultLog(case_name) { - var case_area = case_name.split(".")[0]; - var log_url = "/logs/" + ctrl.testId + "/results/"; - log_url += case_area + "_logs/" + case_name + ".out"; - var is_reachable = false; - - $.ajax({ - url: log_url, - async: false, - success: function (response) { - is_reachable = true; - }, - error: function (response) { - alert("Log file could not be found. Please confirm this case has been executed successfully."); + function openFile(log_url) { + var is_reachable = false; + + $.ajax({ + url: log_url, + async: false, + success: function (response) { + is_reachable = true; + }, + error: function (response) { + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }); + + if (is_reachable == true) { + window.open(log_url); } - }); + } - if (is_reachable == true) { - window.open(log_url); + var log_url = "/logs/" + ctrl.testId + "/results/"; + if (ctrl.version == '2019.04') { + var case_area = case_name.split(".")[0]; + log_url += case_area + "_logs/" + case_name + ".out"; + openFile(log_url); + } else { + var test_url = testapiApiUrl + '/onap/tests/' + ctrl.innerId; + $http.get(test_url).then(function(test_resp){ + var result_url = testapiApiUrl + '/results/' + test_resp.data.results[0]; + $http.get(result_url).then(function(result_resp){ + var keepGoing = true; + angular.forEach(result_resp.data.testcases_list, function(testcase, index) { + if (keepGoing == true) { + if (testcase.name == case_name) { + log_url += testcase.portal_key_file; + openFile(log_url); + keepGoing = false; + } + } + }); + if (keepGoing == true) { + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }, function(result_error) { + alert('Error when get result record'); + }); + }, function(test_error) { + alert('Error when get test record'); + }); } } |