Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6883e8c

Browse files
committed
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.
1 parent 7ae536d commit 6883e8c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/scenario/dsl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ angular.scenario.dsl('select', function() {
302302
* element(selector, label).{method}(key, value) sets the value (as defined by jQuery, ex. attr)
303303
*/
304304
angular.scenario.dsl('element', function() {
305-
var KEY_VALUE_METHODS = ['attr', 'css'];
305+
var KEY_VALUE_METHODS = ['attr', 'css', 'prop'];
306306
var VALUE_METHODS = [
307307
'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width',
308308
'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset'

test/scenario/dslSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,18 @@ describe("angular.scenario.dsl", function() {
287287
expect(doc.find('div').attr('class')).toEqual('bam');
288288
});
289289

290+
it('should get property', function() {
291+
doc.append('<div id="test" class="foo"></div>');
292+
$root.dsl.element('#test').prop('className');
293+
expect($root.futureResult).toEqual('foo');
294+
});
295+
296+
it('should set property', function() {
297+
doc.append('<div id="test" class="foo"></div>');
298+
$root.dsl.element('#test').prop('className', 'bam');
299+
expect(doc.find('div').prop('className')).toEqual('bam');
300+
});
301+
290302
it('should get css', function() {
291303
doc.append('<div id="test" style="height: 30px"></div>');
292304
$root.dsl.element('#test').css('height');

0 commit comments

Comments
 (0)