etaoin

metametadata 2017-10-30T14:00:05.000727Z

@cjsauer yes, I don't think there's any other way in clojure.test to catch test failures

cjsauer 2017-10-30T14:18:07.000376Z

Hm, something is still off. I can't get this code to actually report the exception let alone take a screenshot:

(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
      (binding [*driver* driver]
        (testing (format "Testing in %s browser" (name type))
          (f))))))

(use-fixtures :each driver-fixture)

(deftest ^:acceptance
  test-error
  (with-postmortem {:dir "screenshots/"}
    (do (go *driver* "<https://wikipedia.com>")
        (throw (Exception. "not working")))))

cjsauer 2017-10-30T14:21:19.000127Z

Ran 1 tests containing 0 assertions.
0 failures, 0 errors.

borkdude 2017-10-30T15:57:22.000513Z

@cjsauer FWIF, I use test-ns-hook 😛

borkdude 2017-10-30T16:00:09.000396Z

also FWIF, I use one driver and even one browser for the whole suite if possible, to speed up things, but it can be more error prone

cjsauer 2017-10-30T19:09:09.000047Z

@borkdude I think I'm going to try out the test-ns-hook approach soon

cjsauer 2017-10-30T19:09:55.000168Z

Unrelated to this issue, but is there an open source CircleCI config file I can peek at, and potentially a Dockerfile? I'm having trouble understanding how etaoin works on a CI server.

cjsauer 2017-10-30T19:10:13.000073Z

Specifically the dependencies required.

borkdude 2017-10-30T19:12:11.000402Z

you need to have chromedriver around, but I use a Docker image for that

borkdude 2017-10-30T19:12:34.000166Z

but you can also install chromedriver + Chrome locally (or other browsers)

cjsauer 2017-10-30T19:17:43.000245Z

@borkdude do you know would I be getting obvious error messages if this wasn't installed correctly? Like a chromedriver: command not found kind of error? I keep getting strange errors on my wait-exist commands. They timeout on CircleCI but the :message field is always nil...I've tried capturing a screenshot as well, but the screenshot comes back as a white screen...

cjsauer 2017-10-30T19:18:01.000533Z

I realize this isn't the most helpful debug info 😅

borkdude 2017-10-30T19:18:19.000231Z

not sure about that one, I don’t use CircleCI

borkdude 2017-10-30T19:18:52.000295Z

but I test on my local machine from the REPL and with Docker, so it’s almost the same as on the server

cjsauer 2017-10-30T19:19:33.000553Z

Gotcha. I'll keep digging. Would be amazing to get etaoin running on Circle

cjsauer 2017-10-30T19:20:17.000089Z

Locally my tests run just fine, which makes me think it's a dep issue

borkdude 2017-10-30T19:21:19.000529Z

how do you run locally, with a native browser?

cjsauer 2017-10-30T19:21:47.000055Z

I've tried both the :headless type and the :chrome type. I'm using Chromium locally (native browser)

cjsauer 2017-10-30T19:22:02.000233Z

This is on Ubuntu (Xubuntu)

cjsauer 2017-10-30T19:22:55.000435Z

It usually works just fine. I recently started running into a "cannot load your profile" error when Chromium launches, but I that's a non-related issue

cjsauer 2017-10-30T19:27:55.000368Z

I use this construct to test for a CI server: (def driver-types [(if CI :headless :chrome)])

cjsauer 2017-10-30T19:43:00.000285Z

I'm using this docker image as a base: circleci/clojure:lein-2.7.1-browsers, so I believe that the necessary browser deps are installed

borkdude 2017-10-30T20:02:44.000187Z

I don’t know how this works. Is the docker container available from a port or are you running inside this container?

cjsauer 2017-10-30T20:33:36.000551Z

The tests are run inside the Docker container