   `(when-not (~predicate)
      ~@body))
 
-(defmacro when-not-chrome [driver & body]
+(defmacro when-not-chrome
+  "Executes the body only if a browser is NOT Chrome."
+  [driver & body]
   `(when-not-predicate #(chrome? ~driver) ~@body))
 
-(defmacro when-not-phantom [driver & body]
+(defmacro when-not-phantom
+  "Executes the body only if a browser is NOT Phantom.js."
+  [driver & body]
   `(when-not-predicate #(phantom? ~driver) ~@body))
 
-(defmacro when-not-firefox [driver & body]
+(defmacro when-not-firefox
+  "Executes the body only if a browser is NOT Firefox."
+  [driver & body]
   `(when-not-predicate #(firefox? ~driver) ~@body))
 
-(defmacro when-not-safari [driver & body]
+(defmacro when-not-safari
+  "Executes the body only if a browser is NOT Safari."
+  [driver & body]
   `(when-not-predicate #(safari? ~driver) ~@body))
 
-(defmacro when-predicate [predicate & body]
+(defmacro when-predicate
+  "Executes the body only if a predicate returns true."
+  [predicate & body]
   `(when (~predicate)
      ~@body))
 


  (def driver (chrome))
  (when-chrome driver
    (println \"It's Chrome!\")
"
  [driver & body]
  `(when-predicate #(chrome? ~driver) ~@body))


(def default-interval 0.33)

(defn wait
  "Sleeps for N seconds."
  ([driver sec]
   (wait sec))
  ([sec]
   (Thread/sleep (* sec 1000))))

(defn wait-predicate
  "Sleeps continuously calling a predicate until it returns true.
  Rises a slingshot exception when timeout is reached.

  Arguments:

  - `pred`: a zero-argument predicate to call;
  - `opt`: a map of optional parameters:
  -- `:timeout` wait limit in seconds, 20 by default;
  -- `:interval` how long to wait b/w calls, 0.33 by default;
  -- `:message` a message that becomes a part of exception when timeout is reached."

  ([pred]
   (wait-predicate pred {}))
  ([pred opt]
