* test runs: ** update coverage stats dynamically when returning to run more tests ** replace index page with test run summary statistics ** provide more guidance to users after they submit test results ** considerable page load speed increases at entry points to testing by pushing stats calculations into AJAX which will load after the page loads ** basic test run reporting git-svn-id: svn://10.0.0.236/trunk@224673 18797224-902f-48f8-a5cc-f745e15eee43
30 lines
926 B
JavaScript
30 lines
926 B
JavaScript
var coverageCells;
|
|
|
|
function beginCoverageLookup() {
|
|
coverageCells = document.getElementsByClassName('coverage');
|
|
getCoverage();
|
|
}
|
|
|
|
function getCoverage() {
|
|
var coverageCell = coverageCells.shift();
|
|
if (coverageCell) {
|
|
var test_run_id = coverageCell.id.match(/\d+/);
|
|
var url = 'json.cgi?coverage=1&test_run_id=' + test_run_id;
|
|
fetchJSON(url,updateCoverage,1);
|
|
}
|
|
}
|
|
|
|
function updateCoverage(data) {
|
|
test_run=data;
|
|
|
|
var coverageCell = document.getElementById('coverage_'+test_run.test_run_id);
|
|
if (coverageCell) {
|
|
if (test_run.coverage == 100) {
|
|
coverageCell.setAttribute('class','coverage-complete');
|
|
}
|
|
coverageCell.innerHTML = '<a href="test_run_report.cgi?test_run_id=' +
|
|
test_run.test_run_id + '">' +
|
|
test_run.coverage + '%</a>';
|
|
}
|
|
getCoverage();
|
|
} |