 ;; skip decorator
 ;; conditinal decorator
 ;; with window decorator
+;; todo add local html test
+;;
 
 (def ^:dynamic *server*)
 (def ^:dynamic *session*)

;; predicates
;;

(defn exists?
  ([]
   (try+
    (api/element-tag-name *server* *session* *element*)

(defmacro with-xpath [& body]
  `(with-locator "xpath"
     ~@body))

;;
;; windowing
;;

(defmacro with-window [handler & body]
  `(let [h# (api/get-window-handle *server* *session*)]
     (api/switch-to-window *server* *session* ~handler)
     (try
       ~@body
       (finally
         (api/switch-to-window *server* *session* h#)))))

(defmacro with-all-windows [& body]
  `(doseq [h# (api/get-window-handles *server* *session*)]
     (with-window h#
       ~@body)))

(defn close []
  (api/close-window *server* *session*))

;;
;; navigation
