Mayvenn / limo

A wrapper around selenium webdriver
Eclipse Public License 1.0
25 stars 4 forks source link

click doesn't pass driver through to wait-until-clickable #7

Closed wiseman closed 4 years ago

wiseman commented 6 years ago

When click calls wait-until-clickable it doesn't pass the driver argument, so if you don't have a default *driver* it fails with a NullPointerException.

(defn click
  ([selector-or-element] (click *driver* selector-or-element))
  ([driver selector-or-element]
   (scroll-to driver selector-or-element)
   (wait-until-clickable selector-or-element)
   (wait-for ["click" selector-or-element]
             (.click (element driver selector-or-element))
             true)))
wiseman commented 6 years ago

This might be the same issue as #6 .

wiseman commented 6 years ago

scroll-to has a similar bug.

sheelc commented 6 years ago

@wiseman nice catch! We're guilty of leaning on the default *driver* for most cases (which is probably why we haven't run into this in our day to day). I think fixing this would solve #6

Also, there are several uses of wait-until that don't pass the driver through. Probably worth an audit of all calls of wait-until/wait-until-clickable and thread the driver through @jeffh?

wiseman commented 6 years ago

Yeah, for my current use case I have two drivers open, which I'm sure is unusual.

jeffh commented 6 years ago

Yeah, we need to audit that all of the functions properly thread driver through

jeffh commented 6 years ago

@wiseman, I've done a first-pass through the APIs to properly thread driver through on master. Let me know how it works.

I need to do another walk through for APIs that were added since I made those changes. I figured it would be better to push this instead of waiting until all of them got properly updated.

jeffh commented 4 years ago

This should be fixed in the latest release.