- completato il supporto al futuro Kodi 19\n- ridisegnato infoplus\n- fix vari ed eventuali\n
This commit is contained in:
marco
2020-09-29 21:08:25 +02:00
parent d153ac5918
commit 8a8d1e4f5e
195 changed files with 20697 additions and 23038 deletions
+204
View File
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 class="text-capitalize">{{ title }}</h2>
<p class='attribute'><strong>Start Time: </strong>{{ header_info.start_time.strftime("%Y-%m-%d %H:%M:%S") }}</p>
<p class='attribute'><strong>Duration: </strong>{{ header_info.status.duration }}</p>
<p class='attribute'><strong>Summary: </strong>Total: {{ header_info.status.total }}, <input type="checkbox" id="showPassed" checked>Pass: {{ header_info.status.success }}{% if header_info.status.failure %}, <input type="checkbox" id="showFailed" checked>Fail: {{ header_info.status.failure }}{% endif %}{% if header_info.status.error %}, <input type="checkbox" id="showErrors" checked>Error: {{ header_info.status.error }}{% endif %}{% if header_info.status.skip %}, <input type="checkbox" id="showSkipped" checked>Skip: {{ header_info.status.skip }}{% endif %}</p>
</div>
</div>
{%- for test_case_name, tests_results in all_results|dictsort %}
{%- if tests_results %}
<div class="row">
<div class="col-xs-12 col-sm-10 col-md-10">
<table class='table table-hover table-responsive'>
<thead>
<tr>
<th>{{ test_case_name }}</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{%- for test_case in tests_results %}
{%- if not test_case.subtests is defined %}
<tr class='{{ status_tags[test_case.outcome] }}' style="display: table-row;">
<td class="col-xs-10">{{ test_case.test_id.split(".")[-1] }}</td>
<td class="col-xs-1">
<span class="label label-{{ status_tags[test_case.outcome] }}" style="display:block;width:40px;">
{%- if test_case.outcome == test_case.SUCCESS -%}
Pass
{%- elif test_case.outcome == test_case.SKIP -%}
Skip
{%- elif test_case.outcome == test_case.FAILURE -%}
Fail
{%- else -%}
Error
{%- endif -%}
</span>
</td>
<td class="col-xs-1">
{%- if (test_case.stdout or test_case.err) %}
<button class="btn btn-default btn-xs">View</button>
{%- endif %}
</td>
</tr>
{%- if (test_case.stdout or test_case.err or test_case.err) and test_case.outcome != test_case.SKIP %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if test_case.stdout %}<p style="white-space: pre-line;">{{ test_case.stdout|e }}</p>{% endif %}
{%- if test_case.err %}<p style="color:maroon;">{{ test_case.err[0].__name__ }}: {{ test_case.err[1] }}</p>{% endif %}
{%- if test_case.err %}<p style="color:maroon;">{{ test_case.test_exception_info }}</p>{% endif %}
</td>
</tr>
{%- endif %}
{%- if (test_case.stdout or test_case.err or test_case.err) and test_case.outcome == test_case.SKIP %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if test_case.stdout %}<p style="white-space: pre-line;">{{ test_case.stdout|e }}</p>{% endif %}
{%- if test_case.err %}<p style="color:maroon;">{{ test_case.err }}</p>{% endif %}
</td>
</tr>
{%- endif %}
{%- else %}
<tr class='{{ status_tags[test_case.outcome] }}'>
<td class="col-xs-10">{{ test_case.test_id.split(".")[-1] }}</td>
<td class="col-xs-1">
<span class="label label-{{ status_tags[test_case.outcome] }}" style="display:block;width:40px;">
{%- if test_case.outcome == test_case.SUCCESS -%}
Pass
{%- else -%}
Fail
{%- endif -%}
</span>
</td>
<td class="col-xs-1">
{%- if test_case.subtests %}
<button class="btn btn-default btn-xs">View</button>
{%- endif %}
</td>
</tr>
{%- if test_case.subtests %}
<tr style="display:none;">
<td colspan="3">
<table class='table table-hover table-responsive'>
<tbody>
{%- for subtest in test_case.subtests %}
<tr class='{{ status_tags[subtest.outcome] }}'>
<td class="col-xs-10">{{ subtest.test_id.split(".")[-1] }}</td>
<td class="col-xs-1">
<span class="label label-{{ status_tags[subtest.outcome] }}" style="display:block;width:40px;">
{%- if subtest.outcome == subtest.SUCCESS -%}
Pass
{%- else -%}
Fail
{%- endif -%}
</span>
</td>
<td class="col-xs-1">
{%- if subtest.err %}
<button class="btn btn-default btn-xs">View</button>
{%- endif %}
</td>
</tr>
{%- if subtest.err or subtest.err %}
<tr style="display:none;">
<td class="col-xs-9" colspan="3">
{%- if subtest.err %}<p style="color:maroon;">{{ subtest.err[0].__name__ }}: {{ subtest.err[1] }}</p>{% endif %}
{%- if subtest.err %}<p style="color:maroon;">{{ subtest.test_exception_info }}</p>{% endif %}
</td>
</tr>
{%- endif %}
{% endfor %}
</tbody>
</table>
</td>
</tr>
{%- endif %}
{%- endif %}
{%- endfor %}
<tr>
<td colspan="3">
Total: {{ summaries[test_case_name].total }}, Pass: {{ summaries[test_case_name].success }}{% if summaries[test_case_name].failure %}, Fail: {{ summaries[test_case_name].failure }}{% endif %}{% if summaries[test_case_name].error %}, Error: {{ summaries[test_case_name].error }}{% endif %}{% if summaries[test_case_name].skip %}, Skip: {{ summaries[test_case_name].skip }}{% endif %} -- Duration: {{ summaries[test_case_name].duration }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{%- endif %}
{%- endfor %}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('td').on('click', '.btn', function(e){
e.preventDefault();
e.stopImmediatePropagation();
var $this = $(this);
var $nextRow = $this.closest('tr').next('tr');
$nextRow.slideToggle("fast");
$this.text(function(i, text){
if (text === 'View') {
return 'Hide';
} else {
return 'View';
};
});
});
function hideOrShow(){
$("table").each(function(){
if ($(this).children("tbody").children("tr.success[style*='display: table-row'], tr.danger[style*='display: table-row'], tr.warning[style*='display: table-row'], tr.info[style*='display: table-row']").length ==0){
$(this).hide()
} else {
$(this).show()
}
$(this).find(".btn").each(function(){
$(this).text("View")
});
});
}
$('#showPassed').on('click', function(){
$(".success").toggle(this.checked);
if (this.checked == false) {
$(".success").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showFailed').on('click', function(){
$(".danger").toggle(this.checked);
if (this.checked == false) {
$(".danger").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showErrors').on('click', function(){
$(".warning").toggle(this.checked);
if (this.checked == false) {
$(".warning").next('tr').toggle(this.checked);
}
hideOrShow()
});
$('#showSkipped').on('click', function(){
$(".info").toggle(this.checked);
if (this.checked == false) {
$(".info").next('tr').toggle(this.checked);
}
hideOrShow()
});
});
</script>
</body>
</html>
+11 -10
View File
@@ -52,7 +52,7 @@ validUrlRegex = re.compile(
r'(?::\d+)?' # optional port
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
chBlackList = ['url']
chBlackList = ['url', 'mediasetplay']
chNumRis = {
'altadefinizione01': {
'Film': 20
@@ -120,7 +120,7 @@ chNumRis = {
'Serie TV': 12
},
'serietvonline': {
'Film': 35,
'Film': 50,
'Serie TV': 35
},
'tantifilm': {
@@ -133,6 +133,7 @@ servers = []
channels = []
channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")]
logger.info(channel_list)
ret = []
for chItem in channel_list:
try:
@@ -145,7 +146,7 @@ for chItem in channel_list:
serversFound = {}
for it in mainlist:
print 'preparing ' + ch + ' -> ' + it.title
print('preparing ' + ch + ' -> ' + it.title)
if it.action == 'channel_config':
hasChannelConfig = True
@@ -177,7 +178,7 @@ for chItem in channel_list:
from specials import news
dictNewsChannels, any_active = news.get_channels_list()
print channels
print(channels)
# only 1 server item for single server
serverNames = []
serversFinal = []
@@ -207,7 +208,7 @@ class GenericChannelTest(unittest.TestCase):
title, itemlist in ch['menuItemlist'].items()])
class GenericChannelMenuItemTest(unittest.TestCase):
def test_menu(self):
print 'testing ' + self.ch + ' --> ' + self.title
print('testing ' + self.ch + ' --> ' + self.title)
self.assertTrue(self.module.host, 'channel ' + self.ch + ' has not a valid hostname')
self.assertTrue(self.itemlist, 'channel ' + self.ch + ' -> ' + self.title + ' is empty')
self.assertTrue(self.serversFound,
@@ -245,7 +246,7 @@ class GenericChannelMenuItemTest(unittest.TestCase):
self.assertTrue(nextPageItemlist,
'channel ' + self.ch + ' -> ' + self.title + ' has nextpage not working')
print '<br>test passed'
print('<br>test passed')
@parameterized.parameterized_class(serversFinal)
@@ -253,7 +254,7 @@ class GenericServerTest(unittest.TestCase):
def test_get_video_url(self):
module = __import__('servers.%s' % self.name, fromlist=["servers.%s" % self.name])
page_url = self.server.url
print 'testing ' + page_url
print('testing ' + page_url)
self.assert_(hasattr(module, 'test_video_exists'), self.name + ' has no test_video_exists')
try:
if module.test_video_exists(page_url)[0]:
@@ -261,7 +262,7 @@ class GenericServerTest(unittest.TestCase):
server_parameters = servertools.get_server_parameters(self.name)
self.assertTrue(urls or server_parameters.get("premium"),
self.name + ' scraper did not return direct urls for ' + page_url)
print urls
print(urls)
for u in urls:
spl = u[1].split('|')
if len(spl) == 2:
@@ -274,7 +275,7 @@ class GenericServerTest(unittest.TestCase):
h, v = name.split('=')
h = str(h)
headers[h] = str(v)
print headers
print(headers)
if 'magnet:?' in directUrl: # check of magnet links not supported
continue
page = downloadpage(directUrl, headers=headers, only_headers=True, use_requests=True)
@@ -292,6 +293,6 @@ class GenericServerTest(unittest.TestCase):
if __name__ == '__main__':
if 'KOD_TST_CH' not in os.environ:
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(report_name='report', add_timestamp=False, combine_reports=True,
report_title='KoD Test Suite'), exit=False)
report_title='KoD Test Suite', template=os.path.join(config.get_runtime_path(), 'tests', 'template.html')), exit=False)
else:
unittest.main()