mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-16 21:01:13 +00:00
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.
This commit is contained in:
parent
7ae536d053
commit
6883e8c7a0
2 changed files with 13 additions and 1 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue