/
runner.html
62 lines (58 loc) · 1.7 KB
/
runner.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>NoFlo UI browser tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css">
<style type="text/css">
#app {
width: 800px;
height: 600px;
position: fixed;
right: 0px;
top: 100px;
border: none;
}
</style>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/syn/dist/global/syn.js"></script>
<script>
window.Syn = window.syn;
window.checkSupport = function(m) {
return true;
}
</script>
<script>mocha.setup('bdd');</script>
</head>
<body>
<div id="mocha"></div>
<iframe id="app"></iframe>
<script src="Initialization.js"></script>
<script src="Login.js"></script>
<script src="CreateProject.js"></script>
<script src="EditGraph.js"></script>
<script src="DeleteGraph.js"></script>
<script>
Syn.support.oninput = true;
var runner = mocha.run();
var failedTests = [];
runner.on('end', function(){
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});
runner.on('fail', logFailure);
function logFailure(test, err){
var flattenTitles = function(test){
var titles = [];
while (test.parent.title){
titles.push(test.parent.title);
test = test.parent;
}
return titles.reverse();
};
failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test) });
};
</script>
</body>
</html>