diff options
| -rw-r--r-- | src/scenario/dsl.js | 2 | ||||
| -rw-r--r-- | test/scenario/dslSpec.js | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/scenario/dsl.js b/src/scenario/dsl.js index c51dbb74..8bc4030e 100644 --- a/src/scenario/dsl.js +++ b/src/scenario/dsl.js @@ -302,7 +302,7 @@ angular.scenario.dsl('select', function() { * element(selector, label).{method}(key, value) sets the value (as defined by jQuery, ex. attr) */ angular.scenario.dsl('element', function() { - var KEY_VALUE_METHODS = ['attr', 'css']; + var KEY_VALUE_METHODS = ['attr', 'css', 'prop']; var VALUE_METHODS = [ 'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width', 'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset' diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js index 0334dd78..3160da8d 100644 --- a/test/scenario/dslSpec.js +++ b/test/scenario/dslSpec.js @@ -287,6 +287,18 @@ describe("angular.scenario.dsl", function() { expect(doc.find('div').attr('class')).toEqual('bam'); }); + it('should get property', function() { + doc.append('<div id="test" class="foo"></div>'); + $root.dsl.element('#test').prop('className'); + expect($root.futureResult).toEqual('foo'); + }); + + it('should set property', function() { + doc.append('<div id="test" class="foo"></div>'); + $root.dsl.element('#test').prop('className', 'bam'); + expect(doc.find('div').prop('className')).toEqual('bam'); + }); + it('should get css', function() { doc.append('<div id="test" style="height: 30px"></div>'); $root.dsl.element('#test').css('height'); |
