I'm testing a clojure luminus/selmer application with kerodon.
I'm getting a java.lang.IllegalArgumentException: field could not be found with selector "[:#name]"
when trying to access an input field with id=name
as follows:
(deftest home
(-> (session app)
(visit "/")
(fill-in [:#name] "Peter")
(fill-in [:#age] "25")
(press "Sign up!")
(within [:h1]
(has (text? "Hello Peter 25")))))
Try using text value of label for input field,
fill-in
accepts text value of label as well as id of elem you need to fill. Refer to the kerodon source, there are tests for both label value and selector.For example:-
You can write