diff options
author | Young Gyu Park <younggyu@google.com> | 2018-07-16 15:56:21 +0900 |
---|---|---|
committer | YoungGyu Park <younggyu@google.com> | 2018-08-14 05:08:38 +0000 |
commit | 35707068892d614d836a9b8d8a166d0d0b87b4b8 (patch) | |
tree | bc3e7f6c9f2d9669814683f743b824559afd71c6 /src/main/webapp/js | |
parent | c4798bc4cd5ca6734b5918cef141159c4dfa6876 (diff) | |
download | dashboard-35707068892d614d836a9b8d8a166d0d0b87b4b8.tar.gz |
Rest API for coverage API and API coverage entity
Test: go/vts-web-staging
Bug: 111481322
Change-Id: Iff17ba3906a9127189bb58891d1d5e3e0d82c41b
Diffstat (limited to 'src/main/webapp/js')
-rw-r--r-- | src/main/webapp/js/test_results.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/webapp/js/test_results.js b/src/main/webapp/js/test_results.js index a7be803..e00d6ac 100644 --- a/src/main/webapp/js/test_results.js +++ b/src/main/webapp/js/test_results.js @@ -243,9 +243,9 @@ metadata.testRun.totalLineCount != undefined) { var url = ( '/show_coverage?testName=' + test + '&startTime=' + startTime); - covered = metadata.testRun.coveredLineCount; - total = metadata.testRun.totalLineCount; - covPct = Math.round(covered / total * 1000) / 10; + var covered = metadata.testRun.coveredLineCount; + var total = metadata.testRun.totalLineCount; + var covPct = Math.round(covered / total * 1000) / 10; var color = 'red'; if (covPct > 20 && covPct < 70) { color = 'orange'; @@ -258,6 +258,20 @@ div, coverage, color, function () { window.location.href = url; return false; }); } + if (metadata.testRun.coveredApiCount != undefined && + metadata.testRun.totalApiCount != undefined) { + var covered = metadata.testRun.coveredApiCount; + var total = metadata.testRun.totalApiCount; + var apiCoverage = ('API Coverage: ' + covered + '/' + total); + createClickableIndicator( + div, apiCoverage, 'yellow grey-text', + function (evt) { + $('#apiCoverageModal').data("urlSafeKeyList", metadata.testRun.apiCoverageKeyList); + $('#apiCoverageModal').modal('open'); + return false; + } + ); + } if (metadata.testRun.logLinks != undefined) { createClickableIndicator( div, 'Links', 'grey lighten-1', |