wd icon indicating copy to clipboard operation
wd copied to clipboard

waitForElementByCssSelector promise resolves with value in first arg

Open GulinSS opened this issue 12 years ago • 3 comments

For example:

fn = function(err, v) {};

browser.get('http://google.com').then(fn) // it will pass v in second parameter
browser.waitForElementByCssSelector('a').then(fn) // it will pass v in first parameter

Please, make API more uniform. waitForElementByCssSelector is a first candidate.

GulinSS avatar Aug 15 '14 08:08 GulinSS

I believe get should pass nothing, need to check.

sebv avatar Apr 21 '15 14:04 sebv

I don't fully understand the question but this is just a hunch. maybe the fix would be to remove the '0' index in wd/lib/commands.js for all waitForElement line 1277:

var args = __slice.call(arguments, 0); => var args = __slice.call(arguments);

because it's different than what's in the implementation for commands.get():

line 499: var cb = findCallback(arguments);

caoxu2000 avatar Dec 12 '15 00:12 caoxu2000

promises do not use this form: fn = function(err, v)

sebv avatar Oct 05 '16 11:10 sebv