Skip to content

Commit

Permalink
All the status colors can be set now by editing only two files. Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiag committed Apr 10, 2016
1 parent 4fa7289 commit 6352d25
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

function getTestColors(){
var colors = new Object();
colors.success = "#88ee88";
colors.error = "#E00000";
colors.failure = "#FF9933";
colors.warning = "#F5F500";
colors.success = "#81C784";
colors.error = "#FF8A65";
colors.failure = "#E57373";
colors.warning = "#FFD54F";
return colors;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ function appendTestsToBar(tests, element) {
failurePerSuite.push(this.failure);
warningPerSuite.push(this.warning);
});
barData.datasets.push({"fillColor" : "rgba(136,238,136,0.5)","strokeColor" : "rgba(136,238,136,1)" , "data":successPerSuite});
barData.datasets.push({"fillColor" : "rgba(224,0,0,0.5)","strokeColor" : "rgba(224,0,0,1)" , "data":errorPerSuite});
barData.datasets.push({"fillColor" : "rgba(255,153,51,0.5)","strokeColor" : "rgba(255,153,51,1)" , "data":failurePerSuite});
barData.datasets.push({"fillColor" : "rgba(245,245,0,0.5)","strokeColor" : "rgba(245,245,0,1)" , "data":warningPerSuite});
var colors = getTestColors();
barData.datasets.push({"fillColor" : colors.success,"strokeColor" : colors.success , "data":successPerSuite});
barData.datasets.push({"fillColor" : colors.error,"strokeColor" : colors.error , "data":errorPerSuite});
barData.datasets.push({"fillColor" : colors.failure,"strokeColor" : colors.failure , "data":failurePerSuite});
barData.datasets.push({"fillColor" : colors.warning,"strokeColor" : colors.warning , "data":warningPerSuite});
new Chart(element.getContext("2d")).Bar(barData);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ function appendTestsToSumTable(tests, table) {
total.tests+=tests;
tr.append($('<td>').text(durationHour + "h" + durationMin + "m" + durationSec + "s"));
total.duration += this.duration;
tr.append($('<td>').text(this.success).addClass(this.success > 0 ? "success" : ""));
tr.append($('<td>').text(this.success).addClass(this.success > 0 ? "s_success_back" : ""));
total.success += this.success;
tr.append($('<td>').text(this.error).addClass(this.error > 0 ? "error" : ""));
tr.append($('<td>').text(this.error).addClass(this.error > 0 ? "s_error_back" : ""));
total.error += this.error;
tr.append($('<td>').text(this.failure).addClass(this.failure > 0 ? "failure" : ""));
tr.append($('<td>').text(this.failure).addClass(this.failure > 0 ? "s_failure_back" : ""));
total.failure += this.failure;
tr.append($('<td>').text(this.warning).addClass(this.warning > 0 ? "warning" : ""));
tr.append($('<td>').text(this.warning).addClass(this.warning > 0 ? "s_warning_back" : ""));
total.warning += this.warning;
tr.append($('<td>').text(calculateSuccessRate(this)+"%"));
$(table).append(tr);
Expand All @@ -73,10 +73,10 @@ function appendTestsToSumTable(tests, table) {
durationMin = Math.floor((((durInSec % 31536000) % 86400) % 3600) / 60);
durationSec = (((durInSec % 31536000) % 86400) % 3600) % 60;
tr.append($('<td>').text(durationHour + "h" + durationMin + "m" + durationSec + "s"));
tr.append($('<td>').text(total.success).addClass(total.success > 0 ? "success" : ""));
tr.append($('<td>').text(total.error).addClass(total.error > 0 ? "error" : ""));
tr.append($('<td>').text(total.failure).addClass(total.failure > 0 ? "failure" : ""));
tr.append($('<td>').text(total.warning).addClass(total.warning > 0 ? "warning" : ""));
tr.append($('<td>').text(total.success).addClass(total.success > 0 ? "s_success_back" : ""));
tr.append($('<td>').text(total.error).addClass(total.error > 0 ? "s_error_back" : ""));
tr.append($('<td>').text(total.failure).addClass(total.failure > 0 ? "s_failure_back" : ""));
tr.append($('<td>').text(total.warning).addClass(total.warning > 0 ? "s_warning_back" : ""));
tr.append($('<td>').text(calculateSuccessRate(total)+"%"));
$(table).append(tr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function appendTestsToTable(tests,table){
tr.append($('<td>').append($('<a>').text(this.name).attr("href","tests/test_"+this.uid+"/test.html")));
tr.append($('<td>').text(this.suiteName));
tr.append($('<td>').text(this.machineName));
tr.append($('<td>').text(this.status).addClass(this.status));
tr.append($('<td>').text(this.status).addClass('s_' + this.status + "_back"));
var durInSec = Math.round(this.duration/1000);
var durationHour = Math.floor(((durInSec % 31536000) % 86400) / 3600);
var durationMin = Math.floor((((durInSec % 31536000) % 86400) % 3600) / 60);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function isPropertyExist(element, property) {

function addStatusAsClass(elementToAppend, elementWithStatus) {
if (isPropertyExist(elementWithStatus, "status")) {
elementToAppend.addClass(elementWithStatus.status);
elementToAppend.addClass("s_" + elementWithStatus.status +"_text");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function populateChildren(source, destination) {
switch (this.type) {
case "scenario" :
var children = new Array();
destination.push({'text': this.name, 'icon': suiteIcon(this.status), 'children': children, 'type': this.status , 'a_attr':{'class' : this.status}});
destination.push({'text': this.name, 'icon': suiteIcon(this.status), 'children': children, 'type': this.status , 'a_attr':{'class' : 's_' + this.status +"_text"}});
populateChildren(this.children, children);
break;
case "test":
destination.push({'text': this.index + ". " + this.name, 'icon': testIcon(this.status), 'rel': this.status, 'type': this.status, 'a_attr': {'href': "tests/test_" + this.uid+"/test.html",'class':this.status}});
destination.push({'text': this.index + ". " + this.name, 'icon': testIcon(this.status), 'rel': this.status, 'type': this.status, 'a_attr': {'href': "tests/test_" + this.uid+"/test.html",'class':'s_' + this.status + "_text"}});
break;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ body {
padding-top: 50px;
}

#sumTable td.error { background-color: #999999; }
#sumTable td.success { background-color: #85E085; }
#sumTable td.warning { background-color: #FFE066; }
#sumTable td.failure { background-color: #FF8080; }

/*
* Global add-ons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ table.dataTable td.dataTables_empty {

table.dataTable tr.odd { background-color: #E2E4FF; }
table.dataTable tr.even { background-color: white; }
table.dataTable td.failure { background-color: #FF9933; }
table.dataTable td.success { background-color: #88ee88; }
table.dataTable td.warning { background-color: #F5F500; }
table.dataTable td.error { background-color: #E00000; }
table.dataTable td.inProgress { background-color: #88ee88; }

table.tr.odd td.sorting_1 { background-color: #D3D6FF; }
table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*Used in the 'summary table', 'execution table', ''*/
.s_success_back { background-color: #81C784 !important; }
.s_error_back { background-color: #FF8A65 !important; }
.s_failure_back { background-color: #E57373 !important; }
.s_warning_back { background-color: #FFCA28 !important; }

/*Used in the 'execution tree' ,'test details'*/
.s_success_text { }
.s_error_text { color: #FF8A65 !important; font-weight: bold;}
.s_failure_text { color: #E57373 !important; font-weight: bold;}
.s_warning_text { color: #FFD54F !important; font-weight: bold;}
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@ and open the template in the editor.
margin: 0 auto;
}

.jstree-classic li[rel="succeess"] > a { color: rgb(136,238,136); }
.jstree-node.failure, .jstree-anchor.failure {
color: #EE0000; font-weight: bold; !important;
}
.jstree-node.error , .jstree-anchor.error {
color: #EE0000; font-weight: bold; !important;
}
.jstree-node.success , .jstree-anchor.success{
color: #000000 !important;
/* in case we want different style for success status */
}
.jstree-node.warning , .jstree-anchor.warning{
color: #000000;
}

#tree {
overflow: auto;
min-height: 704px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
<title>Dashboard</title>

<!-- Bootstrap core CSS -->
<link href="css/status_colors.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="css/dashboard.css" rel="stylesheet">

<style>
canvas{
}
Expand Down Expand Up @@ -113,12 +115,12 @@ <h4>Test Status Pie</h4>
<br/>
<table style="margin-left:auto; margin-right:auto;">
<tr>
<td align="left"><div style="width:15px; height:15px; background-color:#85E085; float:left;"></div>&nbsp;= Success&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><div style="width:15px; height:15px; background-color:#FFE066; float:left;"></div>&nbsp;= Warning</td>
<td align="left"><div style="width:15px; height:15px; float:left;" class="s_success_back"></div>&nbsp;= Success&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><div style="width:15px; height:15px; float:left;" class="s_warning_back"></div>&nbsp;= Warning</td>
</tr>
<tr>
<td align="left"><div style="width:15px; height:15px; background-color:#FF8080; float:left;"></div>&nbsp;= Failure</td>
<td align="left"><div style="width:15px; height:15px; background-color:#999999; float:left;"></div>&nbsp;= Error</td>
<td align="left"><div style="width:15px; height:15px; float:left;" class="s_failure_back"></div>&nbsp;= Failure</td>
<td align="left"><div style="width:15px; height:15px; float:left;" class="s_error_back"></div>&nbsp;= Error</td>
</tr>
</table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<link href="css/general_page.css" rel="stylesheet">
<link href="css/jquery-ui-1.8.4.custom.css" rel="stylesheet">
<link href="css/dashboard.css" rel="stylesheet">
<link href="css/status_colors.css" rel="stylesheet">
<link href="css/jquery.dataTables_themeroller.css" rel="stylesheet">
<link href="css/jquery-ui-1.8.4.custom.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>Test Details</title>
<link href="../../css/status_colors.css" rel="stylesheet">
<link href="../../css/general_page.css" rel="stylesheet">
<link href="../../css/test_page.css" rel="stylesheet">
<link href="../../css/lightbox.css" rel="stylesheet">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<link href="css/test_page.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<!--<link href="css/testTree.css" rel="stylesheet">-->
<link href="css/status_colors.css" rel="stylesheet">
<link href="css/tree.css" rel="stylesheet">
<link href="css/dashboard.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
Expand Down

0 comments on commit 6352d25

Please sign in to comment.