-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
102 lines (83 loc) · 3.77 KB
/
index.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
<!--
// ==========================================
// Finch Ideamart Apps Testing Framwork
// ==========================================
// Author : Pasindu De Silva
// Licence : MIT License
// http://opensource.org/licenses/MIT
// ==========================================
-->
<html>
<head>
<title>Finch</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/base-min.css">
<link rel="stylesheet" type="text/css" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/covershot.css">
<link rel="stylesheet" type="text/css" href="css/shCore.css">
<link rel="stylesheet" type="text/css" href="css/shThemeDefault.css">
<script type="text/javascript" src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'> </script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.1/handlebars.min.js"></script>
</head>
<body>
<div id="topContainer">
<div id="topBar">
<div id="topBarContent">
<p class="left">Finch</p>
<p class="right"><a href="index.html" class="selectedFeature">Done By</a><a href="http://pasindu.us">Pasindu De Silva</a></p>
</div>
</div>
<div id="bottomBar">
<div class="holder">
<ul class="summary">
<li>
<span class="coverageData" id="totaltests">0</span>
<p>Total Tests</p>
</li>
<li>
<span class="coverageData" id="passes">0</span>
<p>Passes</p>
</li>
<li>
<span class="coverageData" id="fails">0</span>
<p>Fails</p>
</li>
<li <span class="coverageData" id="fails">Test Url</span><p><input id="testurl" type="text" placeholder="Enter the test file" ></p>
</li>
<li><a href="#" id='runtests' onclick="runtest()" class="classname">Run Tests</a></li>
</ul>
</div>
</div>
</div>
<div id="testtable"></div>
<script type="text/javascript">
function runtest () {
var testurl = document.getElementById("testurl").value;
document.getElementById("runtests").innerHTML="Running";
document.getElementById("runtests").disabled = true;
$.post(testurl,{} ,
function(datap, textStatus, jqXHR){
if (textStatus=="success") {
console.log(datap);
$.getJSON(datap, function(data) {
var ss=' <div id="bodyWrapper"><section id="bod"><section id="mainContent"><table id="files"><thead><tr><th>#</th><th class="number">Test</th><th class="number">Expect</th> <th class="number">Real</th><th>Status</th></tr> </thead><tbody> {{#names}}{{#name}}<tr><td>{{testid}}</td><td>{{tests}}</td><td>{{expect}}</td><td><p>{{real}}</p></td><td data-sort-value""><div class="smplContainer"> <div class="smplSubject" style="width: {{status}}%"></div></div><p class="coverageParagraph"></p></td></tr>{{/name}}{{/names}}</tbody></table></section></section></div>';
var template = Handlebars.compile(ss);
datas={names:data.tests};
document.getElementById("testtable").innerHTML = template(datas);
document.getElementById("passes").innerHTML = data.passes;
document.getElementById("fails").innerHTML = data.fails;
document.getElementById("totaltests").innerHTML = data.fails+data.passes;
document.getElementById("runtests").innerHTML="Run Tests";
document.getElementById("runtests").disabled = false;
});
}else{
document.getElementById("runtests").innerHTML="Test Errors";
document.getElementById("runtests").disabled = true;
}
});
}
var data;
$(function() {
})
</script>
</body>
</html>