From 4fd060a38faa1f938f880fa52746e1a481a9122d Mon Sep 17 00:00:00 2001 From: Julie Date: Wed, 19 Mar 2014 12:47:46 -0700 Subject: [PATCH] fix (element): Allow ElementFinder to be passed to actions directly. Previously, do to an action such as drag and drop, one would have to use `element(by.foo).find()`. Now, just passing `element(by.foo)` works. For example: ```javascript browser.actions().doubleClick(element(by.id('mybutton'))).perform(); ``` --- lib/protractor.js | 2 +- spec/basic/actions_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/protractor.js b/lib/protractor.js index f67b1b5f4..c3d080eea 100644 --- a/lib/protractor.js +++ b/lib/protractor.js @@ -11,7 +11,7 @@ var DEFER_LABEL = 'NG_DEFER_BOOTSTRAP!'; var WEB_ELEMENT_FUNCTIONS = [ 'click', 'sendKeys', 'getTagName', 'getCssValue', 'getAttribute', 'getText', 'getSize', 'getLocation', 'isEnabled', 'isSelected', 'submit', 'clear', - 'isDisplayed', 'getOuterHtml', 'getInnerHtml']; + 'isDisplayed', 'getOuterHtml', 'getInnerHtml', 'toWireValue']; var STACK_SUBSTRINGS_TO_FILTER = [ 'node_modules/minijasminenode/lib/', diff --git a/spec/basic/actions_spec.js b/spec/basic/actions_spec.js index a05e50736..0a6905e89 100644 --- a/spec/basic/actions_spec.js +++ b/spec/basic/actions_spec.js @@ -9,7 +9,7 @@ describe('using an ActionSequence', function() { expect(sliderBar.getAttribute('value')).toEqual('1'); browser.actions(). - dragAndDrop(sliderBar.find(), {x: 400, y: 20}). + dragAndDrop(sliderBar, {x: 400, y: 20}). perform(); expect(sliderBar.getAttribute('value')).toEqual('10');