theintern / leadfoot

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

getSpecAttribute type is incorrect for array context #159

Closed jason0x43 closed 5 years ago

jason0x43 commented 6 years ago

In at least Leadfoot 2.2.x, getSpecAttribute is typed to always return a string, even when the context is an array. It should behave like other element methods (e.g., getVisibleText) and be typed to return an array when the context is an array (which it does).

jason0x43 commented 5 years ago

Since the methods that need updating are all in Command, and Command will have a generic type indicating whether it's dealing with an Element or Element[], we should be able to deal with this using conditional types.