@borkdude maybe it because of weird json string. What browser/OS do you use?
@mac not yet, but it won’t be difficult to implement those APIs
@borkdude also, does the exception info has that json string (it shoud be named :body
)
@igrishaev Just by looking at the code, it’s a bit weird:
(defn fill-el
"Fills an element with text by its identifier."
[driver el text]
(let [keys (if (char? text)
(str text)
text)]
(with-resp driver :post
[:session (:session @driver) :element el :value]
{:value (vec keys)} _)))
keys
is supposed to be a string, which is then converted to a vector ?That is what caused the bug with an older version of cheshire, but a newer version of cheshire can encode a vector of java.lang.Chars
@borkdude I know it looks strange, but still, webdriver requires an array of 1-symbol strings.
I see now. Probably, there might be (mapv str some-sting)
hmm, but it’s first encoded to json right? aaah ok
instead of just vec
I see what happens now: (cheshire.core/generate-string (vec “foo”)) “[\“f\“,\“o\“,\“o\“]”
didn’t know webdriver required this, but now I understand. sorry for the noise
webriver takes something like {"text": ["h", "e", "l", "l", "o"]}
no worries, that’s a good point to prevent an error
I’ll create an issue for that
Can I find svg elements via webdriver protocol?
(eta/exists? *chrome*
{:tag :rect
:class “c3-legend-item-event”})
this currently returns false
when I’m sure this element exists
This works:
{:xpath “//*[local-name() = ‘svg’]//*[@class=‘c3-legend-item-event’]“}
I’ve never tried, don’t know for sure.
I’ve fixed a issue with (vec text)
, use the latest snapshot
cool, thanks!
Hello, excellent library! I'm having trouble getting the with-postmortem
macro working. I've forced my tests to fail but the image directory never gets created. I'm surely missing something obvious:
(ns my-project.acceptance.fixtures
(:require [etaoin.keys :as k]
[clojure.test :refer [testing use-fixtures]]
[adzerk.env :as env])
(:use [etaoin.api]))
(env/def
CIRCLE_ARTIFACTS "acceptance-images"
CI nil)
(def driver-types [(if CI :headless :chrome)])
(def ^:dynamic *driver*)
(defn driver-fixture
"Executes a test running a driver. Bounds a driver
with the global *driver* variable."
[f]
(doseq [type driver-types]
(with-driver type {} driver
(with-postmortem driver {:dir CIRCLE_ARTIFACTS}
(binding [*driver* driver]
(testing (format "Testing in %s browser" (name type))
(f)))))))
Any help would be much appreciated, thank you!I've even tried hard-coding CIRCLE_ARTIFACTS
to prove that it isn't adzerk/env misbehaving
Should mention I'm using 0.1.8-SNAPSHOT
as well