 ;; session
 ;;
 
-(defmacro with-session [capabilities & body]
-  `(binding [*session* (api/new-session *server* ~capabilities)]
+(defmacro with-session [cap-desired cap-required & body]
+  `(binding [*session* (api/new-session *server* ~cap-desired ~cap-required)]
      (try
        ~@body
        (finally

       ~@body)))

;;
;; find elements
;;

(defmacro with-el [term el & body]
  `(let [~el (api/find-element *server* *session* *locator* ~term)]
     ~@body))

(defmacro with-els [term el & body]
  `(for [~el (api/find-elements *server* *session* *locator* ~term)]
     ~@body))

(defmacro with-el-from [parent term el & body]
  `(let [~el (api/find-element-from-element *server* *session* ~parent *locator* ~term)]
     ~@body))

(defmacro with-els-from [el-parent term el & body]
  `(for [~el (api/find-elements-from-element *server* *session* ~el-parent *locator* ~term)]
     ~@body))

(defn with-el-active [el & body]
  `(let [~el (api/get-active-element *server* *session*)]
     ~@body))

;;
;; name and text
;;


     ~@body))

;;
;; find elements
;;

(defmacro with-el [term el & body]
  `(let [~el (api/find-element *server* *session* *locator* ~term)]
     ~@body))

(defmacro with-els [term el & body]
  `(doseq [~el (api/find-elements *server* *session* *locator* ~term)]
     ~@body))

(defmacro with-el-from [parent term el & body]
  `(let [~el (api/find-element-from-element *server* *session* ~parent *locator* ~term)]
     ~@body))

(defmacro with-els-from [el-parent term el & body]
  `(doseq [~el (api/find-elements-from-element *server* *session* ~el-parent *locator* ~term)]
     ~@body))

(defn with-el-active [el & body]
  `(let [~el (api/get-active-element *server* *session*)]
     ~@body))

;;
;; locators
;;

