diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/scenario/DSL.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/scenario/DSL.js b/src/scenario/DSL.js index 2dd37250..3b049dc6 100644 --- a/src/scenario/DSL.js +++ b/src/scenario/DSL.js @@ -89,17 +89,16 @@ angular.scenario.dsl.repeater = function(selector) { angular.scenario.dsl.element = function(selector) { var nameSuffix = "element '" + selector + "'"; return $scenario.addFuture('Find ' + nameSuffix, function(done) { - var self = this; - var element = angular.extend(this.testDocument.find(selector), { - bindings: [], - boundTo: function(name) { return this.bindings[name]; } - }); - element.find('*').each(function() { - var bindName = self.jQuery(this).attr('ng:bind'); - if (bindName) { - element.bindings[bindName] = self.jQuery(this).text(); - } - }); - done(element); + var self = this, repeaterArray = [], ngBindPattern; + var startIndex = selector.search(angular.scenario.dsl.NG_BIND_PATTERN); + if (startIndex >= 0) { + ngBindPattern = selector.substring(startIndex + 2, selector.length - 2); + var element = this.testDocument.find('*').filter(function() { + return self.jQuery(this).attr('ng:bind') == ngBindPattern; + }); + done(element); + } else { + done(this.testDocument.find(selector)); + } }); }; |
