This repository has been archived by the owner on Feb 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathindex.html
190 lines (184 loc) · 9.49 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
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
<!doctype html>
<meta charset=utf-8>
<title>Test Results Viewer</title>
<link rel=stylesheet href="wptview.css">
<div id="wptview" ng-app="wptview" ng-controller="wptviewController" ng-cloak>
<span us-spinner="{radius: 20, length: 15}" spinner-on="busy"></span>
<div ng-click="displayError.visible = false;" class="page">
<h1>Test Results Viewer</h1>
<progress id="progressBar" ng-show="progressBar.visibility" max="100" value="{{ progressValue }}"> </progress>
<section>
<h2>Log Files</h2>
<p ng-if="runs === null">
Loading...
</p>
<div id="runsData" ng-if="runs !== null">
<div>
<table id="runsTable">
<tr>
<th></th>
<th></th>
<th>Run Name</th>
<th>Results Loaded</th>
<th></th>
<th></th>
</tr>
<tr ng-repeat="run in runs">
<td><input type="checkbox" ng-model="run.enabled" ng-change="switchRun(run)" ng-disabled="busy"></td>
<td><img ng-style="{'cursor': 'pointer'}" ng-click="run.edit = !run.edit" src="edit_icon.svg"></td>
<td>
<form name="editNameForm" novalidate>
<input edit-name type="text" ng-show="run.edit" ng-model="run.newName" value="{{run.name}}">
<button ng-click="editNameSubmit($index, editNameForm.$valid)" ng-show="run.edit">Save</button>
<span ng-show="!run.edit">{{ run.name }}</span>
</form>
</td>
<td>{{ run.count }}</td>
<td><button ng-click="clearTable(run.run_id)" ng-disabled="busy">Clear</button></td>
<td>
<img title="{{ run.warnings.length }} warnings" src="warning.svg" ng-style="{'cursor': 'pointer'}" ng-click="showWarnings(run)">
</td>
</tr>
<tfoot>
<tr>
<td colspan=4></td>
<td><button ng-click="clearTable()" ng-disabled="busy || !runs.length">Clear All</button></td>
</tr>
</tfoot>
</table>
</div>
<div>
<div ng-click="showImport = !showImport" class="details-legend">
<span ng-if="!showImport">▶</span>
<span ng-if="showImport">▼</span>
Import
</div>
<div class="import" ng-hide="!showImport">
<form name="fileInput" novalidate>
<input type="radio" ng-model="upload.logSrc" value="file">Upload File</input><br>
<input name="logfile" type="file" id="log_file" custom-on-change="newFile" value="Select File" ng-disabled="busy || upload.logSrc != 'file'"><br>
<input type="radio" ng-model="upload.logSrc" value="url">Fetch from URL</input><br>
<input name="log_url" type="url" id="log_url" ng-model="upload.logUrl" placeholder="URL" ng-disabled="busy || upload.logSrc != 'url'"/>
<br><br>
<input name="run" type="text" ng-model="upload.runName" required ng-disabled="busy" placeholder="Run name">
<button ng-click="fetchLog()" ng-disabled="busy || (upload.logSrc == 'url' && !upload.logUrl) || !upload.runName || (!fileEvent.target.value && upload.logSrc == 'file') || duplicate_run_name() || (upload.logSrc !== 'file' && upload.logSrc !== 'url')" for="fileInput" >Import Log</button>
</form>
</div>
</div>
</div>
</section>
<section ng-hide="runs === null || !runs.length">
<h2>Filter</h2>
<form ng-disabled="busy">
<input type="radio" ng-model="filter.testTypeFilter.type" value="parent">Parent
<input type="radio" ng-model="filter.testTypeFilter.type" value="child">Child
<input type="radio" ng-model="filter.testTypeFilter.type" value="both">Both
</form>
<p>
<label>
By path:<br>
<form>
<button ng-disabled="busy" ng-click="addPath()">Add</button>
<button ng-disabled="busy || filter.pathFilter.length === 0" ng-click="deletePath()">Delete</button>
</form>
<form ng-repeat="i in range(1, filter.pathFilter.length+1)">
<select ng-disabled="busy" ng-model="filter.pathFilter[$index].choice">
<option value="include:start">starts with</option>
<option value="include:end">ends with</option>
<option value="include:contains">contains</option>
<option value="exclude:start">does not start with</option>
<option value="exclude:end">does not end with</option>
<option value="exclude:contains">does not contain</option>
</select>
<input type="text" ng-model="filter.pathFilter[$index].path">
</form>
</p>
<p>
<label>
By result:<br>
<form>
<button ng-disabled="busy" ng-click="addConstraint()">Add</button>
<button ng-disabled="busy || filter.statusFilter.length === 0" ng-click="deleteConstraint()">Delete</button>
</form>
<form ng-repeat="i in range(1, filter.statusFilter.length+1)">
<select ng-disabled="busy" ng-model="filter.statusFilter[$index].run">
<option ng-repeat="run in runs | enabledFilter" value="{{ run.name }}">{{ run.name }}</option>
<option ng-if="runs.length > 1" value="ALL">ALL</option>
</select>
<select ng-disabled="busy" ng-model="filter.statusFilter[$index].equality">
<option value="is">is</option>
<option value="is not">is not</option>
</select>
<label ng-if="filter.statusFilter[$parent.$index].equality == 'is' && $index != 0" ng-repeat-start="j in range(1, filter.statusFilter[$index].status.length+1)">OR</label>
<label ng-if="filter.statusFilter[$parent.$index].equality == 'is not' && $index != 0">AND</label>
<select ng-repeat-end ng-disabled="busy" ng-model="filter.statusFilter[$parent.$index].status[$index]">
<option value="PASS">PASS</option>
<option value="SKIP">SKIP</option>
<option value="ERROR">ERROR</option>
<option value="FAIL">FAIL</option>
<option value="OK">OK</option>
<option value="TIMEOUT">TIMEOUT</option>
<option value="NOTRUN">NOTRUN</option>
<option value="CRASH">CRASH</option>
<option ng-repeat="run in runs | arrFilter: filter.statusFilter[$parent.$index].run" value="result_{{ run.name }}">Results from {{ run.name }}</option>
</select>
<button ng-disabled="busy" ng-click="addOrConstraint($index)">+</button>
<button ng-disabled="busy || filter.statusFilter[$index].status.length <= 1" ng-click="deleteOrConstraint($index)">-</button>
</form>
</section>
<section id="results" ng-hide="runs === null || !runs.length">
<h2>Results</h2>
<form>
Show <input ng-model="resultsView.limit" type="number"> results. <button ng-click="fillTable(0)" ng-disabled="busy || runs === null || runs.length === 0 || !(runs | enabledFilter).length">Load</button>
<button ng-click="export()" ng-disabled="busy || runs === null || runs.length === 0 || !(runs | enabledFilter).length">Save</button>
</form>
<table ng-table="resultsTable" id="resultsTable" ng-if="results !== null">
<tr>
<th rowspan="2">Test</th>
<th rowspan="2">Subtest</th>
<th colspan="2" ng-repeat="run in runs | enabledFilter">{{ run.name }}</th>
</tr>
<tr>
<th ng-repeat-start="run in runs | enabledFilter">Expected</th>
<th ng-repeat-end>Actual</th>
</tr>
<tr ng-repeat="result in results">
<td>{{ result.test }}</td>
<td>{{ result.subtest }}</td>
<td ng-repeat-start="run in result.runs | enabledFilter" class="expected {{run.expected}}">{{ run.expected }}</td>
<td ng-repeat-end class="result {{run.status}}" ng-click="showError(run, result); $event.stopPropagation();">{{ run.status }}</td>
</tr>
</table>
<button ng-if="results !== null" ng-click="fillTable('prev')" ng-disabled="busy || runs === null || runs.length === 0 || resultsView.firstPage">Previous</button>
<button ng-if="results !== null" ng-click="fillTable('next')" ng-disabled="busy || runs === null || runs.length === 0 || resultsView.lastPage">Next</button>
</section>
</div>
<div ng-if="displayWarnings.visible" class="detailsPanel">
<h2> Duplicate tests in {{displayWarnings.runName}} </h2>
<ol>
<li ng-repeat="warning in displayWarnings.warnings">
<div><b>Test</b> : {{ warning.test }}</div>
<div><b>Subtest</b> : {{ warning.subtest }}</div>
</li>
</ol>
</div>
<div ng-if="displayError.visible" class="detailsPanel">
<div style="display: inline-block; max-width: 50%">
<div><b>Test</b> : {{ displayError.test }}</div>
<div><b>Subtest</b> : {{ displayError.subtest }}</div>
<div><b>Expected</b> : <span class="{{ displayError.expected}}">{{ displayError.expected }}</span>
<b>Got</b> : <span class="{{ displayError.status}}">{{ displayError.status }}</span></div>
<div><p id="message"><b>Message</b> : {{ displayError.error }}</p></div>
</div>
<div style="display: inline-block; vertical-align: top; margin-left: 20px; width: 45%">
<b style="vertical-align: top">Comments :</b>
<textarea ng-model="displayError.commentBox" ng-trim="false" cols="40" rows="3"
ng-focus="startCommentSaveTrigger()"
ng-blur="stopCommentSaveTrigger()"></textarea>
</div>
</div>
</div>
<script src="angular.min.js"></script>
<script src="angular_scripts.js"></script>
<script src="spinner/spin.min.js"></script>
<script src="spinner/angular-spinner.min.js"></script>