diff options
Diffstat (limited to '3rd_party')
4 files changed, 81 insertions, 22 deletions
diff --git a/3rd_party/static/testapi-ui/components/home/homeController.js b/3rd_party/static/testapi-ui/components/home/homeController.js index bed86ab..02d2650 100644 --- a/3rd_party/static/testapi-ui/components/home/homeController.js +++ b/3rd_party/static/testapi-ui/components/home/homeController.js @@ -50,7 +50,6 @@ } ctrl.getCompany = function(row){ - //console.log(row) $state.go('directory', {'companyID': row.organization_name, 'logo': row.company_logo}); } diff --git a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html index 3f3e9c9..dee4624 100644 --- a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html +++ b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html @@ -16,6 +16,11 @@ Test Filters:<br> <input type="radio" ng-model="ctrl.testStatus" value="passed" name="passed"> <span class="text-success">Passed</span> </label> + <label class="btn btn-default" ng-click="ctrl.changeStatus('skipped')" + ng-class="{'active': ctrl.testStatus === 'skipped'}"> + <input type="radio" ng-model="ctrl.testStatus" value="skipped" name="skipped"> + <span class="text-warning">Skipped</span> + </label> <label class="btn btn-default" ng-click="ctrl.changeStatus('not passed')" ng-class="{'active': ctrl.testStatus === 'not passed'}"> <input type="radio" ng-model="ctrl.testStatus" value="not passed" name="not passed"> @@ -36,7 +41,7 @@ Test Filters:<br> </uib-accordion-heading> <ol class="capabilities"> <li ng-repeat="(area, value) in data" - ng-show="(ctrl.testStatus == 'passed' && value.pass != 0) || (ctrl.testStatus == 'not passed' && value.fail != 0) || ctrl.testStatus == 'total'"> + ng-show="(ctrl.testStatus == 'passed' && value.pass != 0) || (ctrl.testStatus == 'skipped' && value.skip != 0) || (ctrl.testStatus == 'not passed' && value.fail != 0) || ctrl.testStatus == 'total'"> <a ng-click="value.folder = !value.folder"> {{ area }} <span ng-if="ctrl.testStatus == 'total'" @@ -44,13 +49,16 @@ Test Filters:<br> [{{ value.pass }}/{{ value.total }}] </span> <span ng-if="ctrl.testStatus == 'passed'" class="text-success">[{{ value.pass }}]</span> + <span ng-if="ctrl.testStatus == 'skipped'" class="text-warning">[{{ value.skip }}]</span> <span ng-if="ctrl.testStatus == 'not passed'" class="text-danger">[{{ value.fail }}]</span> </a> <a uib-tooltip="view log" ng-click="ctrl.gotoResultLog(area)"><span class="glyphicon glyphicon-cog"></span></a> <ul class="list-unstyled" uib-collapse="value.folder"> <li ng-repeat="case in value.cases" - ng-if="(ctrl.testStatus=='passed' && ctrl.case_list.indexOf(case) > -1) || (ctrl.testStatus=='not passed' && ctrl.case_list.indexOf(case) == -1) || ctrl.testStatus=='total'"> - <span ng-class="{'glyphicon glyphicon-ok text-success':ctrl.case_list.indexOf(case) > -1, 'glyphicon glyphicon-remove text-warning':ctrl.case_list.indexOf(case) == -1}" + ng-if="(ctrl.testStatus=='passed' && ctrl.case_list.indexOf(case) > -1) || (ctrl.testStatus=='not passed' && ctrl.case_list_fail.indexOf(case) > -1) || (ctrl.testStatus=='skipped' + && ctrl.case_list_skip.indexOf(case) > -1) || ctrl.testStatus=='total'"> + <span ng-class="{'glyphicon glyphicon-ok text-success':ctrl.case_list.indexOf(case) > -1, 'glyphicon glyphicon-minus text-warning':ctrl.case_list_skip.indexOf(case) > -1, + 'glyphicon glyphicon-remove text-danger':ctrl.case_list_fail.indexOf(case) > -1}" aria-hidden="true"></span> <a ng-click="ctrl.gotoDoc(case)">{{ case }}</a> </li> diff --git a/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js b/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js index 8cec126..0c99962 100644 --- a/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js +++ b/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js @@ -36,11 +36,13 @@ ctrl.testStatus = 'total'; ctrl.case_list = []; + ctrl.case_list_skip = []; + ctrl.case_list_fail = []; ctrl.data = {}; ctrl.statistics = { - 'total': 0, 'pass': 0, 'fail': 0, - 'mandatory': {'total': 0, 'pass': 0, 'fail': 0, 'area': 0}, - 'optional': {'total': 0, 'pass': 0, 'fail': 0, 'area': 0} + 'total': 0, 'pass': 0, 'fail': 0, 'skip': 0, + 'mandatory': {'total': 0, 'pass': 0, 'fail': 0, 'skip': 0, 'area': 0}, + 'optional': {'total': 0, 'pass': 0, 'fail': 0, 'skip': 0, 'area': 0} }; ctrl.gotoDoc = gotoDoc; @@ -71,6 +73,18 @@ }); } + function extend_skip(case_list_skip) { + angular.forEach(case_list_skip, function(ele){ + ctrl.case_list_skip.push(ele); + }); + } + + function extend_fail(case_list_fail) { + angular.forEach(case_list_fail, function(ele){ + ctrl.case_list_fail.push(ele); + }); + } + function strip(word) { return word.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } @@ -122,6 +136,7 @@ ctrl.data.mandatory[name].folder = true; ctrl.data.mandatory[name].pass = 0; ctrl.data.mandatory[name].fail = 0; + ctrl.data.mandatory[name].skip = 0; angular.forEach(value.cases, function(sub_case){ ctrl.statistics.total += 1; ctrl.statistics.mandatory.total += 1; @@ -129,7 +144,11 @@ ctrl.data.mandatory[name].pass += 1; ctrl.statistics.mandatory.pass += 1; ctrl.statistics.pass += 1; - }else{ + }else if(ctrl.case_list_skip.indexOf(sub_case) > -1){ + ctrl.data.mandatory[name].skip += 1; + ctrl.statistics.mandatory.skip += 1; + ctrl.statistics.skip += 1; + }else if(ctrl.case_list_fail.indexOf(sub_case) > -1){ ctrl.data.mandatory[name].fail += 1; ctrl.statistics.mandatory.fail += 1; ctrl.statistics.fail += 1; @@ -142,6 +161,7 @@ ctrl.data.optional[name].folder = true; ctrl.data.optional[name].pass = 0; ctrl.data.optional[name].fail = 0; + ctrl.data.optional[name].skip = 0; angular.forEach(value.cases, function(sub_case){ ctrl.statistics.total += 1; ctrl.statistics.optional.total += 1; @@ -149,7 +169,11 @@ ctrl.data.optional[name].pass += 1; ctrl.statistics.optional.pass += 1; ctrl.statistics.pass += 1; - }else{ + }else if(ctrl.case_list_skip.indexOf(sub_case) > -1){ + ctrl.data.optional[name].skip += 1; + ctrl.statistics.optional.skip += 1; + ctrl.statistics.skip += 1; + }else if(ctrl.case_list_fail.indexOf(sub_case) > -1){ ctrl.data.optional[name].fail += 1; ctrl.statistics.optional.fail += 1; ctrl.statistics.fail += 1; @@ -186,15 +210,25 @@ } if(ctrl.version == '2018.01') { - var sub_case_list = get_sub_case_list_2018_01(result_resp.data); + var sub_case_list_total = get_sub_case_list_2018_01(result_resp.data); + var sub_case_list = sub_case_list_total[0]; + var sub_case_list_skip = sub_case_list_total[1]; + var sub_case_list_fail = sub_case_list_total[2]; extend(sub_case_list); + extend_skip(sub_case_list_skip); + extend_fail(sub_case_list_fail); } else if(ctrl.version == '2018.09') { // OVP 2018.09 and later results store all results in a single json structure: // Looping over all test cases of this individual test run angular.forEach(result_resp.data.testcases_list, function(testcase, index){ - var sub_case_list = get_sub_case_list_2018_09(testcase) - extend(sub_case_list) + var sub_case_list_total = get_sub_case_list_2018_09(testcase); + var sub_case_list = sub_case_list_total[0]; + var sub_case_list_skip = sub_case_list_total[1]; + var sub_case_list_fail = sub_case_list_total[2]; + extend(sub_case_list); + extend_skip(sub_case_list_skip); + extend_fail(sub_case_list_fail); }); } @@ -220,19 +254,26 @@ function yardstickPass_2018_01(result) { var case_list = []; + var case_list_skip = []; + var case_list_fail = []; angular.forEach(result.details.results, function(ele){ if(ele.benchmark){ if(ele.benchmark.data.sla_pass == 1){ case_list.push(result.case_name); - return case_list; + } else if(ele.benchmark.data.sla_skip == 1){ + case_list_skip.push(result.case_name); + } else if(ele.benchmark.data.sla_fail == 1){ + case_list_fail.push(result.case_name); } } }); - return case_list; + return [case_list, case_list_skip, case_list_fail]; } function functestPass_2018_01(result){ var case_list = []; + var case_list_skip = []; + var case_list_fail = []; if(result.case_name == 'refstack_defcore'){ angular.forEach(result.details.success, function(ele){ if(strip(ele) == 'tempest.api.identity.v3.test_t'){ @@ -248,24 +289,40 @@ }else{ if(result.criteria == 'PASS'){ case_list.push(result.case_name); + } else if(result.criteria == 'SKIP'){ + case_list_skip.push(result.case_name); + } else if(result.criteria == 'FAIL') { + case_list_fail.push(result.case_name); } } - return case_list; + return [case_list, case_list_skip, case_list_fail]; } function get_sub_case_list_2018_09(result) { var case_list = []; + var case_list_skip = []; + var case_list_fail = []; if(result.sub_testcase.length == 0 && result.result == "PASS") { case_list.push(result.name); } + else if(result.sub_testcase.length == 0 && result.result == "SKIP") { + case_list_skip.push(result.name); + } + else if(result.sub_testcase.length == 0 && result.result == "FAIL") { + case_list_fail.push(result.name); + } else { angular.forEach(result.sub_testcase, function(subtest, index) { if(subtest.result == "PASS") { - case_list.push(subtest.name) + case_list.push(subtest.name); + } else if(subtest.result == "SKIP") { + case_list_skip.push(subtest.name); + } else if(subtest.result == "FAIL") { + case_list_fail.push(subtest.name); } }); } - return case_list; + return [case_list, case_list_skip, case_list_fail]; } function gotoDoc(sub_case){ diff --git a/3rd_party/static/testapi-ui/components/results/resultsController.js b/3rd_party/static/testapi-ui/components/results/resultsController.js index 03c367c..6e4e0ac 100644 --- a/3rd_party/static/testapi-ui/components/results/resultsController.js +++ b/3rd_party/static/testapi-ui/components/results/resultsController.js @@ -112,7 +112,6 @@ ctrl.isUserResults = $state.current.name === 'userResults'; ctrl.currentUser = $scope.auth.currentUser ? $scope.auth.currentUser.openid : null; - console.log($scope.auth); // Should only be on user-results-page if authenticated. if (ctrl.isUserResults && !$scope.auth.isAuthenticated) { @@ -184,7 +183,6 @@ } else { result[item] = newValue; - console.log('update success'); } }, function(error){ alert("Error when update data"); @@ -281,8 +279,6 @@ function uploadFile(){ var file = $scope.resultFile; - console.log('file is ' ); - console.dir(file); var uploadUrl = testapiApiUrl + "/results/upload"; uploadFileToUrl(file, uploadUrl); @@ -315,7 +311,6 @@ ctrl.totalItems = ctrl.data.pagination.total_pages * ctrl.itemsPerPage; ctrl.currentPage = ctrl.data.pagination.current_page; ctrl.numPages = ctrl.data.pagination.total_pages; - console.log(ctrl.data); }).error(function (error) { ctrl.data = null; ctrl.totalItems = 0; |