Commit a636336a authored by Jérome Perrin's avatar Jérome Perrin

Zelenium: do not include (HTML) link in case of expected failure

89115b88 is great, but with "testFunctionalAnonymousSelection" the
result HTML is more than 40Mo.

/reviewed-on nexedi/erp5!772
parent a76b5815
...@@ -502,15 +502,18 @@ objectExtend(HtmlTestCaseRow.prototype, { ...@@ -502,15 +502,18 @@ objectExtend(HtmlTestCaseRow.prototype, {
// Store the test HTML as a dataURL to ease debugging from posted test results // Store the test HTML as a dataURL to ease debugging from posted test results
// This code should be synchronous (no Blob asDataURL method for example) // This code should be synchronous (no Blob asDataURL method for example)
var aElement = this.trElement.ownerDocument.createElement("a"); // We don't do this with "expected failures" tests, not to create too big result pages
aElement.textContent = ' (HTML)'; if (testFrame.currentTestCase.headerRow.trElement.textContent.indexOf("expected failure") === -1) {
function b64EncodeUnicode(str) { var aElement = this.trElement.ownerDocument.createElement("a");
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { aElement.textContent = ' (HTML)';
return String.fromCharCode('0x' + p1); function b64EncodeUnicode(str) {
})); return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
return String.fromCharCode('0x' + p1);
}));
}
aElement.href = 'data:text/html;charset=utf-8;base64,' + b64EncodeUnicode(sel$('selenium_myiframe').contentWindow.document.body.innerHTML);
this.trElement.cells[2].appendChild(aElement);
} }
aElement.href = 'data:text/html;charset=utf-8;base64,' + b64EncodeUnicode(sel$('selenium_myiframe').contentWindow.document.body.innerHTML);
this.trElement.cells[2].appendChild(aElement);
}, },
setMessage: function(message) { setMessage: function(message) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment