Commit 81293bb9 81293bb95ad1c2aab0f9ea0f9d40e6785ae5ec21 by Nicolas Perriault

switched to more standard .textContent property to get node text

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