browser-monkey
Advanced tools
Comparing version 1.19.0 to 1.20.0
@@ -146,2 +146,6 @@ var retry = require('trytryagain'); | ||
function getNormalisedText(el) { | ||
return el[0].innerText.replace(/ +/g,' ').replace(/ *\n */g,"\n"); | ||
} | ||
return { | ||
@@ -158,7 +162,7 @@ find: function(element) { | ||
if (text !== undefined) { | ||
assertElementProperties(els, text, function (e) { return e.text(); }); | ||
assertElementProperties(els, text, function (e) { return getNormalisedText(e); }); | ||
} | ||
if (exactText !== undefined) { | ||
assertElementProperties(els, exactText, function (e) { return e.text(); }, true); | ||
assertElementProperties(els, exactText, function (e) { return getNormalisedText(e); }, true); | ||
} | ||
@@ -165,0 +169,0 @@ |
{ | ||
"name": "browser-monkey", | ||
"version": "1.19.0", | ||
"version": "1.20.0", | ||
"description": "reliable dom testing", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -440,2 +440,16 @@ require('lie/polyfill'); | ||
it('eventually finds an element containing text as it appears on the page', function () { | ||
var promise = browser.find('.element', {text: 'This is some text that is all on one line.\nAnd some more on another line'}).shouldExist(); | ||
eventuallyInsertHtml('<div class="element"><div>\ | ||
This\ | ||
is\ | ||
some\ | ||
text\ | ||
that is all on one line.\ | ||
<br/>\ | ||
And some more on another line.\ | ||
</div></div>'); | ||
return promise; | ||
}); | ||
it('eventually finds an element containing exactText', function () { | ||
@@ -442,0 +456,0 @@ var good = browser.find('.a', {exactText: '8'}).shouldExist(); |
62762
1323