Browse files

Add fix that actually works for wait-until. Really fixes #47

  • Loading branch information...
1 parent f2a8690 commit 40eff31f656b315fab637b75cf7c07dd5ebc114b @semperos committed Mar 1, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/clj_webdriver/wait.clj
View
9 src/clj_webdriver/wait.clj
@@ -27,5 +27,12 @@
([driver pred timeout interval]
(let [wait (WebDriverWait. (:webdriver driver) (/ timeout 1000) interval)]
(.until wait (proxy [ExpectedCondition] []
- (apply [d] (pred (init-driver {:webdriver d})))))
+ (apply [d] (let [result (pred (init-driver {:webdriver d}))]
+ ;; This allows us to wrap zero-arity functions
+ ;; in a single-arity function, so we don't need
+ ;; to write a macro or different function.
+ ;; (Taxi API support)
+ (if (fn? result)
+ (result)
+ result)))))
driver))))

0 comments on commit 40eff31

Please sign in to comment.