Commit 81293bb9 81293bb95ad1c2aab0f9ea0f9d40e6785ae5ec21 by Nicolas Perriault

switched to more standard .textContent property to get node text

1 parent 80dc3af6
Subproject commit a13ffd86fd88a9f0f82ddcec38fc121ca2554001
Subproject commit c17e8c952e7405d3cf6f78cafb1539ad0b16c59d
......
......@@ -349,7 +349,7 @@ Casper.prototype.debugHTML = function debugHTML() {
*/
Casper.prototype.debugPage = function debugPage() {
this.echo(this.evaluate(function _evaluate() {
return document.body.innerText;
return document.body.textContent || document.body.innerText;
}));
return this;
};
......
......@@ -165,7 +165,7 @@
var text = '', elements = this.findAll(selector);
if (elements && elements.length) {
Array.prototype.forEach.call(elements, function _forEach(element) {
text += element.innerText;
text += element.textContent || element.innerText;
});
}
return text;
......
......@@ -355,8 +355,8 @@ var Tester = function Tester(casper, options) {
*/
this.assertTextExists = this.assertTextExist = function assertTextExists(text, message) {
var textFound = (casper.evaluate(function _evaluate() {
return document.body.innerText;
}).indexOf(text) != -1);
return document.body.textContent || document.body.innerText;
}).indexOf(text) !== -1);
return this.assert(textFound, message, {
type: "assertTextExists",
details: "Text was not found within the document body textual contents",
......