more detailled test output for assertSelectorContains()
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -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 | }; | ... | ... |
-
Please register or sign in to post a comment