-
Notifications
You must be signed in to change notification settings - Fork 5
/
template.html
204 lines (187 loc) · 8.86 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<title>Test Results {{Browser}}</title>
<link rel="stylesheet" href="{{bootstrap_Path}}/css/bootstrap.css" />
<link rel="stylesheet" href="{{fontawesome_Path}}/css/all.css" />
<style>
html, body#REPORT_TEMPLATE {height:100%;font-family: Arial, Helvetica, sans-serif;padding:0px;margin:0px;background:#efefef;}
#REPORT_TEMPLATE #browser {font-size:12px;}
#REPORT_TEMPLATE span.result {display:inline-block;margin-right:20px;background-color:#fff;padding:2px 8px;color:#000;}
#REPORT_TEMPLATE table {border:1px solid #ccc;border-collapse:collapse;width:100%;table-layout: fixed;}
#REPORT_TEMPLATE th {background-color:#acf;}
#REPORT_TEMPLATE td,th {border:1px solid #fff;font-size:14px;width:auto;}
#REPORT_TEMPLATE td.expand {width:25px;}
#REPORT_TEMPLATE td.status {width:100px;padding-left:10px;}
#REPORT_TEMPLATE td.error {padding:0px;background-color: #ffffff;}
#REPORT_TEMPLATE td.error pre {padding:10px;border:1px solid #721c24;margin-bottom:0px;}
#REPORT_TEMPLATE tr.alert-active > td { background-color:#f5f5f5; }
#REPORT_TEMPLATE #timestamp {font-size:12px;margin-left:10px;}
#REPORT_TEMPLATE #refreshToggle {color:#fff;}
#REPORT_TEMPLATE #refreshToggle button {margin-left:10px;}
#REPORT_TEMPLATE .countBox {height:100px;text-align:center;color:#aaa;border:1px solid #fff;font-size:.9em;}
#REPORT_TEMPLATE .countBox h2 { color:#000;margin:15px 0px 5px 0px;}
#REPORT_TEMPLATE .countBox.alert-success {background-color:#dff0d8;}
#REPORT_TEMPLATE .countBox.alert-info {background-color:#d9edf7;}
#REPORT_TEMPLATE .countBox.alert-active {background-color:#f5f5f5;}
#REPORT_TEMPLATE .countBox.alert-danger {background-color:#f2dede;}
#REPORT_TEMPLATE .whiteout {background-color:#fff;padding:1px 15px;}
#REPORT_TEMPLATE .row.clear {margin-top:45px;}
#REPORT_TEMPLATE h3 {margin-top:20px;margin-bottom:20px;color:#666;}
#REPORT_TEMPLATE .menu {list-style-type: none;padding-left:10px;font-size:1.1em;}
#REPORT_TEMPLATE .menu li {list-style-type: none;}
#REPORT_TEMPLATE #refreshBtn {outline:none;}
</style>
<script src="{{jquery_Path}}/jquery.min.js"></script>
<script>
var reload = shouldReload();
var visibleStates = {{DefaultVisibilityStates}};
function shouldReload() {
if (location.search != null && location.search != undefined && location.search.length > 0)
return location.search.substr(1) === 'true' ? true : false;
else
return {{Auto_Reload}};
};
var setState = function(status) {
if (status) {
$('#refreshBtn').removeClass('btn-danger');
$('#refreshBtn').addClass('btn-success');
$('#refreshBtn').text('Enable Refresh');
} else {
$('#refreshBtn').removeClass('btn-success');
$('#refreshBtn').addClass('btn-danger');
$('#refreshBtn').text('Disable Refresh');
}
};
var refresh = function() {
if (reload) {
location.reload(true);
}
};
var loadValuesFromStorage = function(){
try{
var value = JSON.parse(localStorage['VisibleStates']);
visibleStates = value || visibleStates;
}catch(e){
//For some reason we don't support local getValueFromLocalStorage
//Old version of IE?
}
}
var saveValueInStorage = function(){
try{
localStorage['VisibleStates'] = JSON.stringify(visibleStates);
}catch(e){
//For some reason we don't support local getValueFromLocalStorage
//Old version of IE?
}
}
var toggleHiddenState = function(){
var id = $(this).attr('id');
if(!id || !visibleStates.hasOwnProperty(id)) return;
visibleStates[id] = !visibleStates[id];
displayItems(id);
saveValueInStorage();
}
var displayItems = function(id){
var visible = visibleStates[id];
var eye = $('span', '#'+ id);
var items = $(('.alert-' + id), '.whiteout');
var openEye = 'fa-eye';
var closedEye = 'fa-eye-slash';
if(visible) {
items.removeClass('d-none');
eye.removeClass(closedEye);
eye.addClass(openEye);
}
else {
eye.removeClass(openEye);
items.addClass('d-none');
eye.addClass(closedEye);
}
}
$(document).ready(function() {
setState(!reload);
loadValuesFromStorage();
for(name in visibleStates){
displayItems(name);
}
$('.countBox').click(toggleHiddenState);
$('#refreshBtn').click(function() {
setState(reload);
if (reload) {
reload = false;
} else {
reload = true;
refresh();
}
});
setTimeout(refresh, {{Refresh_Timeout}});
});
</script>
</head>
<body id="REPORT_TEMPLATE">
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark" role="navigation">
<div class="container-fluid">
<span class="navbar-brand">Test Results <span id="browser">{{Browser}}</span></span>
<div id="refreshToggle" class="mt-2 mt-md-0 float-right">
<span id="timestamp">{{DateTime_Stamp}}</span>
<button class="btn btn-danger" id="refreshBtn">Disable Refresh</button>
</div>
</div>
</nav>
<div class="container-fluid" style="height:100%;">
<div class="row" style="height:100%;">
<div class="col-sm-2" style="padding:0px;height:100%;">
<div class="whiteout col-sm-2" style="height:100%;padding:75px 15px;position:fixed;">
<ul class="menu">
<li><a href="#Overview">Overview</a></li>
<li><a href="#Details">Details</a></li>
</ul>
</div>
</div>
<div class="col-sm-10" style="padding-top:75px;" id="Overview">
<div class="row">
<div class="col-sm-2">
<div class="countBox alert-info">
<h2>{{Total_Test_Count}}</h2>
Total Tests
</div>
</div>
<div class="col-sm-2 col-sm-offset-1">
<div class="countBox alert-success" id="success">
<h2>{{Total_Pass_Count}}</h2>
Passed Tests
<span class="far fa-eye"></span>
</div>
</div>
<div class="col-sm-2 col-sm-offset-1">
<div class="countBox alert-danger" id="danger">
<h2>{{Total_Fail_Count}}</h2>
Failed Tests
<span class="far fa-eye"></span>
</div>
</div>
<div class="col-sm-2 col-sm-offset-1">
<div class="countBox alert-active" id="active">
<h2>{{Total_Skip_Count}}</h2>
Skipped Tests
<span class="far fa-eye"></span>
</div>
</div>
</div>
<div class="row clear">
<div class="col-sm-12">
<div class="cold-sm-12 whiteout">
<h3 id="Details">Details</h3>
{{Test_Results}}
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{{bootstrap_Path}}/js/bootstrap.min.js"></script>
</body>
</html>