theintern / leadfoot

A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.
Other
170 stars 24 forks source link

Return array values when context is Element[] #138

Closed jason0x43 closed 4 years ago

jason0x43 commented 6 years ago

Ideally, getVisibleText in this instance should resolve to an array:

remote
  .findAllByCssSelector('.item')
  .getVisibleText()
  .then(value => {
    // should be string[], but is string
  })
jason0x43 commented 6 years ago

This will likely require the use of TS 2.8 conditional types or a separate CommandMulti (or something) type that will be returned by the findAll methods.

If we went the CommandMulti route, The CommandMulti type would just be an extension of Command that returned array values for the relevant methods (like getVisibleText).

jason0x43 commented 4 years ago

This was fixed in 3cdba41