-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplateResult.html
168 lines (129 loc) · 3.04 KB
/
templateResult.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
<!DOCTYPE html>
<html>
<head>
<title>Test Result</title>
<style type="text/css">
*{
padding: 0;
margin:0;
font-family: 'Lato', sans-serif;
box-sizing: border-box;
}
body{
background-color: grey;
display: flex;
justify-content: center;
}
.container{
background-color: #fafafa;
width: 80%;
height: 100%;
min-height: 100vh
}
.bundle{
margin:10px;
border: 5px solid black;
height: 80vh;
display: flex;
justify-content: center;
}
.screenshot{
height: 100%;
display: flex;
justify-content: center;
}
.screenshot img{
height: 100%;
}
.description{
display: flex;
flex-direction: column;
background-color: #eaeaea;
width: 50%;
height: 100%;
padding: 15px;
overflow: scroll;
}
.description h1{
padding: 10px;
background-color: #fafafa;
}
.description p{
padding: 10px;
background-color: #fafafa;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="bundle">
<div class="description">
<h1 class="testName">testName:</h1>
<p class="testID">testID:</p>
<p class="UDID">UDID:</p>
<p class="outputDir">outputDir:</p>
<p class="testChildren">testChildren:</p>
<p class="systemPort">systemPort:</p>
<p class="port">port:</p>
<p class="bpPort">bpPort:</p>
<p class="desCaps">desCaps:</p>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
resizeDiv();
});
let testData={{testData}}
console.log(testData)
$(".testName").text(testData.testName)
$(".testID").append(testData.testID)
$(".UDID").append(testData.UDID)
$(".outputDir").append(testData.outputDir)
$(".testChildren").append(testData.testChildren)
$(".systemPort").append(testData.systemPort)
$(".port").append(testData.port)
$(".bpPort").append(testData.bpPort)
$(".desCaps").append(JSON.stringify(testData.desCaps,null,"\n"))
fnPrintSteps(testData.steps);
function fnPrintSteps(steps){
let htmlblueprint=' <div class="bundle">\
<div class="screenshot">{{screenshot}}</div>\
<div class="description">\
<h1>{{message}}</h1>\
{{appendSpace}}\
</div>\
</div>';
console.log(steps)
for(var x=0; x<steps.length; x++){
let blueprint=htmlblueprint;
let step=steps[x];
if(step.img!=undefined)
blueprint=blueprint.replace("{{screenshot}}","<img src='"+step.img+"'>")
else{
blueprint=blueprint.replace("{{screenshot}}","")
}
blueprint=blueprint.replace("{{message}}",step.message);
let allfields="";
for(let key in step) {
value = step[key]
if(key!=undefined||step[key]!=undefined){
allfields=allfields+"<p>"+key+":"+step[key]+"</p>"
}
}
blueprint=blueprint.replace("{{appendSpace}}",allfields)
$(".container").append(blueprint);
}
}
window.onresize = function(event) {
resizeDiv();
}
function resizeDiv() {
vph = $(window).height();
$('.bundle').css({"height": vph + "px"});
}
</script>
</body>
</html>