Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add preconditions for select- and deselect-option

  • Loading branch information...
commit ae6c75b735934165f886a18c4cc19bfd787456b7 1 parent b945b9b
@semperos semperos authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/clj_webdriver/core_element.clj
View
6 src/clj_webdriver/core_element.clj
@@ -126,6 +126,9 @@
(lazy-seq (.getAllSelectedOptions select-list))))
(deselect-option [element attr-val]
+ {:pre [(or (= (first (keys attr-val)) :index)
+ (= (first (keys attr-val)) :value)
+ (= (first (keys attr-val)) :text))]}
(case (first (keys attr-val))
:index (deselect-by-index element (:index attr-val))
:value (deselect-by-value element (:value attr-val))
@@ -164,6 +167,9 @@
(= value "multiple"))))
(select-option [element attr-val]
+ {:pre [(or (= (first (keys attr-val)) :index)
+ (= (first (keys attr-val)) :value)
+ (= (first (keys attr-val)) :text))]}
(case (first (keys attr-val))
:index (select-by-index element (:index attr-val))
:value (select-by-value element (:value attr-val))
Please sign in to comment.
Something went wrong with that request. Please try again.