aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2011-09-16 00:05:13 +0200
committerIgor Minar2011-09-16 02:44:34 +0200
commit6883e8c7a0c121319ced63596718d34e3ab650a8 (patch)
tree49bcfe944b6e72bddf86379bf1b7a13b571504b0
parent7ae536d0532b7ad7859f9cf7e47b406f63383f29 (diff)
downloadangular.js-6883e8c7a0c121319ced63596718d34e3ab650a8.tar.bz2
feat(scenarioRunner): adding support for element().prop()
since jQuery 1.6.4 attr() focuses only on work with element attributes and doesn't deal well with element properties, so adding prop() support is required for getting many e2e tests to pass after upgrading the runner to jQuery 1.6.4.
-rw-r--r--src/scenario/dsl.js2
-rw-r--r--test/scenario/dslSpec.js12
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');