网上的汉化文件下载之后汉化是没问题了但是看log会有点问题,所以参考对照汉化了下,使用源文件,仅对文本进行汉化。
C:\Python\Lib\site-packages\robot\htmldata\rebot
report.html
打开 Robot Framework 报告失败
- 请验证在您的浏览器设置中 已启用JavaScript.
- 确定您使用的是比较新的浏览器. 推荐使用Firefox 3.5, IE 8, 或者与他版本相当的浏览器以及比它们版本靠后的浏览器ß.
- 检查在您的浏览器上面是否 JavaScript错误日志的消息. 如果您怀疑这是一个报告的bug请报告技术团队.
view.js
function removeJavaScriptDisabledWarning() {
// Not using jQuery here for maximum speed
document.getElementById('javascript-disabled').style.display = 'none';
}
function addJavaScriptDisabledWarning(error) {
if (window.console)
console.error('Opening failed: ' + error.name + ': ' + error.message);
document.getElementById('javascript-disabled').style.display = 'block';
}
function initLayout(suiteName, type) {
parseTemplates();
setTitle(suiteName, type);
addHeader();
addReportOrLogLink(type);
}
function parseTemplates() {
$('script[type="text/x-jquery-tmpl"]').map(function (idx, elem) {
$.template(elem.id, elem.text);
});
}
function testOrTask(text) {
return text.replace(/{(.*)}/, function (match, group, offset, string) {
if (!window.settings.rpa)
return group;
return {'TEST': 'TASK', 'Test': 'Task', 'test': 'task'}[group];
});
}
function setTitle(suiteName, type) {
var givenTitle = window.settings.title;
var title = givenTitle ? givenTitle : suiteName + " " + type;
document.title = util.unescape(title);
}
function addHeader() {
var generated = util.timestamp(window.output.generated);
$.tmpl('${title}
' +
'' +
'生成
${generated}
' +
'${ago} \u4e4b\u524d' +
'' +
'', {
generated: util.createGeneratedString(generated),
ago: util.createGeneratedAgoString(generated),
title: document.title
}).appendTo($('#header'));
}
function addReportOrLogLink(myType) {
var url;
var text;
var container = $('#report-or-log-link');
if (myType == '测试报告') {
url = window.settings.logURL;
text = '日志';
} else {
url = window.settings.reportURL;
text = '测试报告';
}
if (url) {
container.find('a').attr('href', url);
container.find('a').text(text);
} else {
container.remove();
}
}
function addStatistics() {
var statHeaders =
'\u603b\u8ba1 ' +
'\u901a\u8fc7 ' +
'\u5931\u8d25 ' +
'\u8017\u65f6 ' +
'\u901a\u8fc7/\u5931\u8d25 ';
var statTable =
'{Test} \u6d4b\u8bd5\u7edf\u8ba1
' +
'' +
'统计总数 ' + statHeaders +
'
' +
'' +
'标签统计 ' + statHeaders +
'
' +
'' +
'套件统计 ' + statHeaders +
'
';
$(testOrTask(statTable)).appendTo('#statistics-container');
util.map(['total', 'tag', 'suite'], addStatTable);
addTooltipsToElapsedTimes();
enableStatisticsSorter();
}
function addTooltipsToElapsedTimes() {
$('.stats-col-elapsed').attr('title',
testOrTask('Total execution time of these {test}s. ') +
'Excludes suite setups and teardowns.');
$('#suite-stats').find('.stats-col-elapsed').attr('title',
'Total execution time of this suite.');
}
function enableStatisticsSorter() {
$.tablesorter.addParser({
id: 'statName',
type: 'numeric',
is: function(s) {
return false; // do not auto-detect
},
format: function(string, table, cell, cellIndex) {
// Rows have class in format 'row-'.
var index = $(cell).parent().attr('class').substring(4);
return parseInt(index);
}
});
$(".statistics").tablesorter({
sortInitialOrder: 'desc',
headers: {0: {sorter:'statName', sortInitialOrder: 'asc'},
5: {sorter: false}}
});
}
function addStatTable(tableName) {
var stats = window.testdata.statistics()[tableName];
if (tableName == 'tag' && stats.length == 0) {
renderNoTagStatTable();
} else {
renderStatTable(tableName, stats);
}
}
function renderNoTagStatTable() {
$('' +
'没有标签 ' +
' ' +
' ' +
' ' +
' ' +
'' +
'' +
' ' +
' ').appendTo('#tag-stats');
}
function renderStatTable(tableName, stats) {
var template = tableName + 'StatisticsRowTemplate';
var tbody = $('');
for (var i = 0, len = stats.length; i < len; i++) {
$.tmpl(template, stats[i], {index: i}).appendTo(tbody);
}
tbody.appendTo('#' + tableName + '-stats');
}
$.template('statColumnsTemplate',
'${total} ' +
'${pass} ' +
'${fail} ' +
'${elapsed} ' +
'' +
'{
{if total}}' +
'' +
'' +
'' +
'' +
'{
{else}}' +
'' +
'{
{/if}}' +
' '
);
$.template('suiteStatusMessageTemplate',
'${critical} critical {
{= testOrTask("{test}")}}, ' +
'${criticalPassed} passed, ' +
'${criticalFailed} failed
' +
'${total} {
{= testOrTask("{test}")}} total, ' +
'${totalPassed} passed, ' +
'${totalFailed} failed'
);
// For complete cross-browser experience..
// http://www.quirksmode.org/js/events_order.html
function stopPropagation(event) {
var event = event || window.event;
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}