-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
201 lines (177 loc) · 9.25 KB
/
report.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
<!DOCTYPE html>
<html>
<head>
<title>Report</title>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">
<style>
code > pre {
background-color: #D9D9D9;
}
.test-case {
}
.test-case--passed {
background-color: #A1D490;
}
.test-case--failed {
background-color: #F25757;
}
.test-case--warning {
}
.filter-wrapper {
padding: 10px;
}
.filter--active {
background-color: #D6D6D6;
}
.filter-wrapper .material-icons {
pointer-events: none;
}
.search-wrapper {
/*display: inline-block;*/
}
.search-wrapper > input {
border: 0;
/*margin: 0;*/
}
.search-wrapper > input:focus {
border: 0;
}
.search-wrapper > .material-icons {
position: absolute;
top: 10px;
right: 10px;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<div class="container">
<div class="row">
<div class="col s12">
<h1>Test Report</h1>
</div>
</div>
<div class="row">
<div class="col s12">
<h4>Summary</h4>
<div class="row">
<div class="col s2">
<ul>
<li><strong>Total</strong>: 1</li>
<li><strong>Error</strong>: 1</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<h4>Test Results</h4>
<div class="search-wrapper card">
<input id="page-search" />
<i class="material-icons">search</i>
</div>
<div class="filter-wrapper">
<span>Filter:</span>
<a id="filter-all" data-filter-result="all" class="waves-effect waves-light btn">All</a>
<a id="filter-pass" data-filter-result="passed" class="waves-effect waves-light btn-flat"><i class="material-icons left">done</i>Passed</a>
<a id="filter-fail" data-filter-result="failed" class="waves-effect waves-light btn-flat"><i class="material-icons left">error</i>Failed</a>
<a id="filter-error" data-filter-result="error" class="waves-effect waves-light btn-flat"><i class="material-icons left">error</i>Error</a>
<a id="filter-skip" data-filter-result="skipped" class="waves-effect waves-light btn-flat"><i class="material-icons left">warning</i>Skipped</a>
</div>
<ul class="collapsible" data-collapsible="accordian">
<li data-filter-result="error" data-search-key="nose2.loader.LoadTestsFailure.output/tests/acceptance_tests.html">
<div class="collapsible-header test-case--error">
<i class="material-icons">
error
</i>
nose2.loader.LoadTestsFailure.output/tests/acceptance_tests.html
</div>
<div class="collapsible-body">
<strong>Description</strong>
<p><em>This test has no docstring...</em></p>
<strong>Result: error</strong>
<br/>
<strong>Traceback</strong>
<code><pre>Traceback (most recent call last):
File "C:\Users\nickl\AppData\Local\Programs\Python\Python310\lib\unittest\case.py", line 59, in testPartExecutor
yield
File "C:\Users\nickl\AppData\Local\Programs\Python\Python310\lib\unittest\case.py", line 591, in run
self._callTestMethod(testMethod)
File "C:\Users\nickl\AppData\Local\Programs\Python\Python310\lib\unittest\case.py", line 549, in _callTestMethod
method()
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\loader.py", line 120, in testFailure
six.reraise(*exception)
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\six.py", line 719, in reraise
raise value
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\plugins\loader\functions.py", line 81, in loadTestsFromName
result = util.test_from_name(name, module)
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\util.py", line 92, in test_from_name
parent, obj = object_from_name(name, module)
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\util.py", line 112, in object_from_name
(module, import_error) = try_import_module_from_name(parts[:])
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\util.py", line 171, in try_import_module_from_name
six.reraise(*import_error)
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\six.py", line 719, in reraise
raise value
File "C:\Users\nickl\AppData\Local\pypoetry\Cache\virtualenvs\sudoku-kpriBEho-py3.10\lib\site-packages\nose2\util.py", line 165, in try_import_module_from_name
module = __import__(".".join(splitted_name))
ModuleNotFoundError: No module named 'output/tests/acceptance_tests'
</pre></code>
</div>
</li>
</ul>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/js/materialize.min.js"></script>
<script type="text/javascript">
// Map test cases to their search terms
var AUTOCOMPLETE_TERMS_MAP = {"nose2.loader.LoadTestsFailure.output/tests/acceptance_tests.html": "nose2.loader.LoadTestsFailure.output/tests/acceptance_tests.html"};
var AUTOCOMPLETE_TERMS_ARRAY = Object.keys(AUTOCOMPLETE_TERMS_MAP);
$(function() {
$('.filter-wrapper > a').click(function(ev) {
ev.preventDefault();
$('.filter-wrapper > a').removeClass('btn').addClass('btn-flat');
$('#' + ev.target.id).removeClass('btn-flat').addClass('btn');
var filterChoice = $(ev.target).attr('data-filter-result');
if (filterChoice === 'all') {
$('ul.collapsible > li').show();
} else {
$('ul.collapsible > li').hide();
$('ul.collapsible > li[data-filter-result="' + filterChoice + '"]').show();
}
});
var materialize_autocomplete_obj = {};
Object.keys(AUTOCOMPLETE_TERMS_MAP).forEach(function(item) {
materialize_autocomplete_obj[item] = null
});
$('#page-search').autocomplete({
data: materialize_autocomplete_obj
});
$('#page-search').change(function(ev) {
var searchTerm = $(this).val();
console.log(searchTerm);
if (searchTerm.length === 0) {
$('ul.collapsible > li').show();
return;
}
if (Object.keys(AUTOCOMPLETE_TERMS_MAP).indexOf(searchTerm) < 0) {
return;
}
var matchingTestCases = AUTOCOMPLETE_TERMS_MAP[searchTerm];
console.log(matchingTestCases);
$('ul.collapsible > li').each(function(_, el) {
if (matchingTestCases.indexOf($(el).attr('data-search-key')) >= 0) {
$(el).show();
} else {
$(el).hide();
}
});
});
});
</script>
</body>
</html>