@@ -212,6 +212,27 @@ clientSideScripts.findRepeaterColumn = function() {
212
212
* arguments[0] {Element} The scope of the search.
213
213
* arguments[1] {string} The model name.
214
214
*
215
+ * @return {Array.<Element? } The matching input elements.
216
+ */
217
+ clientSideScripts . findInputs = function ( ) {
218
+ var using = arguments [ 0 ] || document ;
219
+ var model = arguments [ 1 ] ;
220
+ var prefixes = [ 'ng-' , 'ng_' , 'data-ng-' , 'x-ng-' , 'ng\\:' ] ;
221
+ for ( var p = 0 ; p < prefixes . length ; ++ p ) {
222
+ var selector = 'input[' + prefixes [ p ] + 'model="' + model + '"]' ;
223
+ var inputs = using . querySelectorAll ( selector ) ;
224
+ if ( inputs . length ) {
225
+ return inputs ;
226
+ }
227
+ }
228
+ } ;
229
+
230
+ /**
231
+ * Find input elements by model name.
232
+ *
233
+ * arguments[0] {Element} The scope of the search.
234
+ * arguments[1] {string} The model name.
235
+ *
215
236
* @return {Element } The first matching input element.
216
237
*/
217
238
clientSideScripts . findInput = function ( ) {
@@ -701,6 +722,10 @@ ProtractorBy.prototype.input = function(model) {
701
722
findOverride : function ( driver , using ) {
702
723
return driver . findElement (
703
724
webdriver . By . js ( clientSideScripts . findInput ) , using , model ) ;
725
+ } ,
726
+ findArrayOverride : function ( driver , using ) {
727
+ return driver . findElements (
728
+ webdriver . By . js ( clientSideScripts . findInputs ) , using , model ) ;
704
729
}
705
730
} ;
706
731
} ;
0 commit comments