diff options
| author | Andreas Marek | 2013-05-06 10:20:15 +0200 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-14 20:50:36 +0100 |
| commit | 629fb37351ce5778a40a8bc8cd7c1385b382ce75 (patch) | |
| tree | 4580bd3ea41c0bb492ac58e5f669cd9ecf3d2ce8 /src/ngScenario/dsl.js | |
| parent | 908821e20af311be905e24639dce273f2ea58434 (diff) | |
| download | angular.js-629fb37351ce5778a40a8bc8cd7c1385b382ce75.tar.bz2 | |
feat(scenario): adds mousedown and mouseup event triggers to scenario
Added mousedown and mouseup event triggers to scenadio dsl 'element' expression.
Added mousedown and mouseup to the custom jquery trigger method to generate real events.
Diffstat (limited to 'src/ngScenario/dsl.js')
| -rw-r--r-- | src/ngScenario/dsl.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js index 9d46e0cf..67a56af9 100644 --- a/src/ngScenario/dsl.js +++ b/src/ngScenario/dsl.js @@ -328,6 +328,8 @@ angular.scenario.dsl('select', function() { * element(selector, label).count() get the number of elements that match selector * element(selector, label).click() clicks an element * element(selector, label).mouseover() mouseover an element + * element(selector, label).mousedown() mousedown an element + * element(selector, label).mouseup() mouseup an element * element(selector, label).query(fn) executes fn(selectedElements, done) * element(selector, label).{method}() gets the value (as defined by jQuery, ex. val) * element(selector, label).{method}(value) sets the value (as defined by jQuery, ex. val) @@ -392,6 +394,22 @@ angular.scenario.dsl('element', function() { }); }; + chain.mousedown = function() { + return this.addFutureAction("element '" + this.label + "' mousedown", function($window, $document, done) { + var elements = $document.elements(); + elements.trigger('mousedown'); + done(); + }); + }; + + chain.mouseup = function() { + return this.addFutureAction("element '" + this.label + "' mouseup", function($window, $document, done) { + var elements = $document.elements(); + elements.trigger('mouseup'); + done(); + }); + }; + chain.query = function(fn) { return this.addFutureAction('element ' + this.label + ' custom query', function($window, $document, done) { fn.call(this, $document.elements(), done); |
