Commit ab8f3ded ab8f3ded3a30919165869e9d2a3ab85e571916f9 by Mickaël Andrieu

Merge pull request #1079 from andy-g/fetchText_handle_form_elements

refs #1078 - Handle form elements in fetchText (waitForSelectorTextChange)
2 parents df30390d c165386b
......@@ -230,7 +230,7 @@
var text = '', elements = this.findAll(selector);
if (elements && elements.length) {
Array.prototype.forEach.call(elements, function _forEach(element) {
text += element.textContent || element.innerText;
text += element.textContent || element.innerText || element.value;
});
}
return text;
......
......@@ -9,6 +9,15 @@ casper.test.begin('fetchText() basic tests', 1, function(test) {
});
});
casper.test.begin('fetchText() basic tests', 1, function(test) {
casper.start('tests/site/index.html', function() {
test.assertEquals(this.fetchText('input[name="dummy_name"]'), 'dummy_value',
'Casper.fetchText() can retrieve text contents from an input element');
}).run(function() {
test.done();
});
});
casper.test.begin('fetchText() handles HTML entities', 1, function(test) {
casper.start().then(function() {
this.setContent('<html><body>Voil&agrave;</body></html>');
......