ForbesLindesay / taxi-rank

A JSDom based Selenium Webdriver API
MIT License
346 stars 12 forks source link

Is this promised based? or is the API 100% synchronous? #16

Closed ORESoftware closed 7 years ago

ORESoftware commented 7 years ago

If this is promised based, perhaps include an example using Promises and where they apply?

ForbesLindesay commented 7 years ago

This is http based, i.e. it's just a server. Whether it uses Promises, synchronous code, or something else, depends entirely on what client you use.

The recommended client is cabbie, which comes in both "sync" and "async" mode (the latter of which uses promises). See https://cabbiejs.org/ (I'm still working on full documentation for cabbie).

ORESoftware commented 7 years ago

I meant specifically:

  // navigate to a url in the currently active window
  driver.browser.activeWindow.navigateTo('http://example.com');

does that return a Promise or...? seems very unclear

ForbesLindesay commented 7 years ago

If you use cabbie-sync it is synchronous, if you use cabbie-async it is asynchronous. If you use another web driver client it can vary.

ForbesLindesay commented 7 years ago

The readme example is synchronous.