        ~@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
 ;;
 

  (Thread/sleep (* sec 1000)))

(defn wait-for-predicate
  [predicate & {:keys [timeout poll]
                :or {timeout 10 poll 0.5}}]
  (loop [times 0
         time-rest timeout]
    (when (< time-rest 0)
      (throw+ {:type :webdriver/timeout
               :timeout timeout
               :poll poll
               :times times

       ~@body)))

;;
;; tests
;;

(deftest simple-test
  (let [host "127.0.0.1"
        port (random-port)
        args ["geckodriver" "--host" host "--port" port]
        html "<input class=\"input__control input__input\" tabindex=\"2\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-autocomplete=\"list\" aria-label=\"Запрос\" id=\"text\" maxlength=\"400\" name=\"text\">"
        input "//input[@id='text']"]

    ;; with-start host port
    (proc/with-proc p [args]
      (with-server host port
        (wait-running :message "The server did not start.")
        (with-session {} {}
          (client/with-pool {}
            (go-url "http://ya.ru")
            (wait-has-text "Найти" :message "Найти was not found on the page")
            (js-set-hash "fooooo")
            ;; (with-url url
            ;;   (is (= url 1)))
