etaoin

igrishaev 2017-10-27T05:55:19.000109Z

@borkdude maybe it because of weird json string. What browser/OS do you use?

igrishaev 2017-10-27T05:55:55.000079Z

@mac not yet, but it won’t be difficult to implement those APIs

igrishaev 2017-10-27T05:56:43.000158Z

@borkdude also, does the exception info has that json string (it shoud be named :body)

borkdude 2017-10-27T09:00:51.000330Z

@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 ?

borkdude 2017-10-27T09:01:33.000028Z

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

igrishaev 2017-10-27T09:02:14.000146Z

@borkdude I know it looks strange, but still, webdriver requires an array of 1-symbol strings.

igrishaev 2017-10-27T09:03:15.000077Z

I see now. Probably, there might be (mapv str some-sting)

borkdude 2017-10-27T09:03:17.000085Z

hmm, but it’s first encoded to json right? aaah ok

igrishaev 2017-10-27T09:03:25.000163Z

instead of just vec

borkdude 2017-10-27T09:03:45.000461Z

I see what happens now: (cheshire.core/generate-string (vec “foo”)) “[\“f\“,\“o\“,\“o\“]”

borkdude 2017-10-27T09:04:00.000179Z

didn’t know webdriver required this, but now I understand. sorry for the noise

igrishaev 2017-10-27T09:04:10.000133Z

webriver takes something like {"text": ["h", "e", "l", "l", "o"]}

igrishaev 2017-10-27T09:04:29.000372Z

no worries, that’s a good point to prevent an error

igrishaev 2017-10-27T09:04:51.000480Z

I’ll create an issue for that

borkdude 2017-10-27T12:23:51.000080Z

Can I find svg elements via webdriver protocol?

(eta/exists? *chrome*
                   {:tag :rect
                    :class “c3-legend-item-event”})

borkdude 2017-10-27T12:24:45.000131Z

this currently returns false when I’m sure this element exists

borkdude 2017-10-27T12:27:01.000159Z

This works:

{:xpath “//*[local-name() = ‘svg’]//*[@class=‘c3-legend-item-event’]“}

igrishaev 2017-10-27T12:27:58.000219Z

I’ve never tried, don’t know for sure.

igrishaev 2017-10-27T13:47:54.000529Z

I’ve fixed a issue with (vec text), use the latest snapshot

borkdude 2017-10-27T14:33:08.000648Z

cool, thanks!

cjsauer 2017-10-27T18:01:17.000528Z

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!

cjsauer 2017-10-27T18:02:37.000537Z

I've even tried hard-coding CIRCLE_ARTIFACTS to prove that it isn't adzerk/env misbehaving

cjsauer 2017-10-27T18:03:18.000395Z

Should mention I'm using 0.1.8-SNAPSHOT as well