Commit 3f1d2a39 3f1d2a3991e0314e04a6b00298c18f077ec58f85 by Nicolas Perriault

more detailled test output for assertSelectorContains()

1 parent 848791c2
...@@ -666,13 +666,15 @@ Tester.prototype.assertFalsy = function assertFalsy(subject, message) { ...@@ -666,13 +666,15 @@ Tester.prototype.assertFalsy = function assertFalsy(subject, message) {
666 Tester.prototype.assertSelectorHasText = 666 Tester.prototype.assertSelectorHasText =
667 Tester.prototype.assertSelectorContains = function assertSelectorHasText(selector, text, message) { 667 Tester.prototype.assertSelectorContains = function assertSelectorHasText(selector, text, message) {
668 "use strict"; 668 "use strict";
669 var textFound = this.casper.fetchText(selector).indexOf(text) !== -1; 669 var got = this.casper.fetchText(selector);
670 var textFound = got.indexOf(text) !== -1;
670 return this.assert(textFound, message, { 671 return this.assert(textFound, message, {
671 type: "assertSelectorHasText", 672 type: "assertSelectorHasText",
672 standard: f('Found "%s" within the selector "%s"', text, selector), 673 standard: f('Found "%s" within the selector "%s"', text, selector),
673 values: { 674 values: {
674 selector: selector, 675 selector: selector,
675 text: text 676 text: text,
677 actualContent: got
676 } 678 }
677 }); 679 });
678 }; 680 };
......