diff options
| author | Misko Hevery | 2010-11-07 13:04:48 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-11-07 13:06:55 -0800 |
| commit | 91b6c5f7ffaa19f967547ae3916641fed9e0f04c (patch) | |
| tree | 24be352f7e30519848e1364db5ea2dd6ff87e983 /src/scenario/dsl.js | |
| parent | 5be325a0c1a660268d29541bc668d9cb7d641fcb (diff) | |
| download | angular.js-91b6c5f7ffaa19f967547ae3916641fed9e0f04c.tar.bz2 | |
Added documentation for validators.
BACKWARD INCOMPATIBLE: removed ssn validators, since it is unlikely that most people will need it and if they do, they can added it thorough RegExp
Diffstat (limited to 'src/scenario/dsl.js')
| -rw-r--r-- | src/scenario/dsl.js | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/scenario/dsl.js b/src/scenario/dsl.js index f37ab71d..99bc63a9 100644 --- a/src/scenario/dsl.js +++ b/src/scenario/dsl.js @@ -191,7 +191,7 @@ angular.scenario.dsl('input', function() { chain.enter = function(value) { return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", function($window, $document, done) { - var input = $document.elements('input[name="$1"]', this.name); + var input = $document.elements(':input[name="$1"]', this.name); input.val(value); input.trigger('change'); done(); @@ -200,7 +200,7 @@ angular.scenario.dsl('input', function() { chain.check = function() { return this.addFutureAction("checkbox '" + this.name + "' toggle", function($window, $document, done) { - var input = $document.elements('input:checkbox[name="$1"]', this.name); + var input = $document.elements(':checkbox[name="$1"]', this.name); input.trigger('click'); done(); }); @@ -209,7 +209,7 @@ angular.scenario.dsl('input', function() { chain.select = function(value) { return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'", function($window, $document, done) { var input = $document. - elements('input:radio[name$="@$1"][value="$2"]', this.name, value); + elements(':radio[name$="@$1"][value="$2"]', this.name, value); input.trigger('click'); done(); }); @@ -224,29 +224,6 @@ angular.scenario.dsl('input', function() { /** * Usage: - * textarea(name).enter(value) enters value in the text area with specified name - */ -angular.scenario.dsl('textarea', function() { - var chain = {}; - - chain.enter = function(value) { - return this.addFutureAction("textarea '" + this.name + "' enter '" + value + "'", function($window, $document, done) { - var textarea = $document.elements('textarea[name="$1"]', this.name); - textarea.val(value); - textarea.trigger('change'); - done(); - }); - }; - - return function(name) { - this.name = name; - return chain; - }; -}); - - -/** - * Usage: * repeater('#products table', 'Product List').count() number of rows * repeater('#products table', 'Product List').row(1) all bindings in row as an array * repeater('#products table', 'Product List').column('product.name') all values across all rows in an array |
