Skip to content

Commit

Permalink
Improve fill-multi/fill-human-multi errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dgr committed Sep 1, 2024
1 parent 5bbe8c7 commit 3a3615e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2761,11 +2761,12 @@
(fill driver q text))
(throw+ {:type :etaoin/argument
:message "Vector q-text must have even length"
:arg q-text}))
:q-text q-text
:length (count q-text)}))

:else (throw+ {:type :etaoin/argument
:message "Wrong argument type"
:arg q-text})))
:message "Argument q-text must be a map or vector"
:q-text q-text})))

(defn fill-human-el
"Have `driver` fill element `el` with `text` as if it were a real human using `opts`.
Expand Down Expand Up @@ -2836,12 +2837,13 @@
(doseq [[q text] (partition 2 q-text)]
(fill driver q text))
(throw+ {:type :etaoin/argument
:message "Vector q-text must have even length"
:arg q-text}))
:message "Vector q-text must have even length"
:q-text q-text
:length (count q-text)}))

:else (throw+ {:type :etaoin/argument
:message "Wrong argument type"
:arg q-text}))))
:message "Argument q-text must be a map or vector"
:q-text q-text}))))

(defn select
"Convenience function to have `driver` select first option that includes `text` for select element found by query `q`.
Expand Down

0 comments on commit 3a3615e

Please sign in to comment.