Better formated test result output

pull/744/head
Ozzieisaacs 6 years ago
parent d0fd1a4601
commit 7255c26568

File diff suppressed because it is too large Load Diff

@ -1,36 +1,47 @@
output_list = Array();
/* Level - 0: Summary; 1: Failed; 2: All; 3: Skipped */
/* Level - 0: Summary; 1: Failed; 2: All; 3: Skipped 4: Error*/
function showCase(level) {
table_rows = document.getElementsByTagName("tr");
for (var i = 0; i < table_rows.length; i++) {
row = table_rows[i];
id = row.id;
// Show failed if all or failed or summary problems selected
if (id.substr(0,2) == 'ft') {
if (level < 1 || level == 3) {
row.classList.add('hiddenRow');
if (level == 2|| level == 1 || level == 5 ) {
row.classList.remove('hiddenRow');
}
else {
row.classList.remove('hiddenRow');
row.classList.add('hiddenRow');
}
}
// Show passed if all selected
if (id.substr(0,2) == 'pt') {
if (level > 1 && level != 3) {
if (level == 2 ) {
row.classList.remove('hiddenRow');
}
else {
row.classList.add('hiddenRow');
}
}
// Show skipped if all or skipped or summary problems selected
if (id.substr(0,2) == 'st') {
if (level >=2) {
if (level ==2 || level ==3 || level == 5) {
row.classList.remove('hiddenRow');
}
else {
row.classList.add('hiddenRow');
}
}
// Show error if all or error or summary problems selected
if (id.substr(0,2) == 'et') {
if (level ==4 || level == 2 || level == 5 ) {
row.classList.remove('hiddenRow');
}
else {
row.classList.add('hiddenRow');
}
}
}
}
@ -51,6 +62,10 @@ function showClassDetail(class_id, count) {
testcase_id = 's' + testcase_postfix_id;
testcase = document.getElementById(testcase_id);
}
if (!testcase) {
testcase_id = 'e' + testcase_postfix_id;
testcase = document.getElementById(testcase_id);
}
testcases_list[i] = testcase;
if (testcase.classList.contains('hiddenRow')) {
all_hidden = false;
@ -89,22 +104,9 @@ function html_escape(s) {
return s;
}
/* obsoleted by detail in <div>
function showOutput(id, name) {
var w = window.open("", //url
name,
"resizable,scrollbars,status,width=800,height=450");
d = w.document;
d.write("<pre>");
d.write(html_escape(output_list[id]));
d.write("\n");
d.write("<a href='javascript:window.close()'>close</a>\n");
d.write("</pre>\n");
d.close();
}
*/
// rgb(38, 154, 188)#31b0d5
function drawCircle(pass, fail, error, skip){
var color = ["#5cb85c","#d9534f","#c00","#f0ad4e"];
var color = ["#5cb85c","#d9534f","#31b0d5","#f0ad4e"];
var data = [pass,fail,error,skip];
var text_arr = ["pass", "fail", "error","skip"];
@ -136,21 +138,21 @@ function drawCircle(pass, fail, error, skip){
function show_img(obj) {
var obj1 = obj.nextElementSibling
obj1.style.display='block'
var index = 0;//每张图片的下标,
var index = 0;
var len = obj1.getElementsByTagName('img').length;
var imgyuan = obj1.getElementsByClassName('imgyuan')[0]
//var start=setInterval(autoPlay,500);
obj1.onmouseover=function(){//当鼠标光标停在图片上,则停止轮播
obj1.onmouseover=function(){
clearInterval(start);
}
obj1.onmouseout=function(){//当鼠标光标停在图片上,则开始轮播
obj1.onmouseout=function(){
start=setInterval(autoPlay,1000);
}
for (var i = 0; i < len; i++) {
var font = document.createElement('font')
imgyuan.appendChild(font)
}
var lis = obj1.getElementsByTagName('font');//得到所有圆圈
var lis = obj1.getElementsByTagName('font');
changeImg(0)
var funny = function (i) {
lis[i].onmouseover = function () {
@ -165,12 +167,12 @@ function show_img(obj) {
function autoPlay(){
if(index>len-1){
index=0;
clearInterval(start); //运行一轮后停止
clearInterval(start);
}
changeImg(index++);
}
imgyuan.style.width= 25*len +"px";
//对应圆圈和图片同步
function changeImg(index) {
var list = obj1.getElementsByTagName('img');
var list1 = obj1.getElementsByTagName('font');

Loading…
Cancel
Save