Fork me on GitHub
#hoplon
<
2016-05-16
>
thedavidmeister14:05:21

I’m using webdriver + FF

thedavidmeister14:05:49

(deftask tests-web
  "Run all web tests"
  [ w watch? bool "Watches the filesystem and reruns tests when changes are made."
    W wip? bool "true to only run WIP tests. WIP tests will not run if false."]
  (set-env! :source-paths #(into % ["test/hl"]))
  (comp
    (serve  :port 8001
            :handler 'app.handler/app
            :reload false
            :httpkit true)
    (if watch?
        (comp
          (watch)
          (speak))
        identity)
    (hoplon)
    (cljs)
    (target :dir #{"target_test"})
    (test
      :filters [(test-filter-for-wip wip?)])))

thedavidmeister14:05:30

works pretty much like other tests...

leontalbot15:05:48

@thedavidmeister: Cool! What is watch? ?

leontalbot15:05:04

and (test-filter-for-wip wip?) Would you mind sharing those?

thedavidmeister15:05:41

watch is just in the definition of the task

thedavidmeister15:05:54

boot tests-web -w -W would only run WIP tests and watch

thedavidmeister15:05:14

(defn test-filter-for-wip
  [wip?]
  (if wip?
      '(:wip (meta %))
      '(not (:wip (meta %)))))

thedavidmeister15:05:57

i mostly use watch instead of the repl, so i get some basic tests for free as i dev

thedavidmeister15:05:53

boot deps, if you’re interested

thedavidmeister15:05:57

; Testing
                  [crisptrutski/boot-cljs-test            "0.2.2-SNAPSHOT"]
                  [adzerk/boot-test                       "1.1.1"]
                  [org.clojure/test.check                 "0.9.0"]
                  [org.seleniumhq.selenium/selenium-java  "2.52.0"]
                  [clj-webdriver                          "0.7.2”]]

onetom16:05:06

@dm3: @thedavidmeister what do you use as the integration test DSL? something like https://github.com/xeqi/kerodon for example?

thedavidmeister16:05:35

@onetom: that’s cool, i haven’t seen that

thedavidmeister16:05:48

i’ve just been using the taxi api of clj-webdriver

thedavidmeister16:05:04

(defn first-is-current?
  []
  ; Current is on the first input, item, item-list.
  (is (attribute (element ".item-list") :data-current))
  (is (= 1 (count (elements ".item-list[data-current]"))))
  (is (attribute (element ".item") :data-current))
  (is (= 1 (count (elements ".item[data-current]"))))
  (is (attribute (element ".item label") :data-current))
  (is (= 1 (count (elements ".item label[data-current]")))))

dm319:05:47

@micha: regarding ^ if you haven't read http://smuglispweeny.blogspot.ch/2008/02/cells-manifesto.html seems to have all of the evaluation strategies for cells simple_smile

micha19:05:07

yes i have read the manifesto 🙂

micha19:05:11

lazy evaluation requires a more traditional FRP model

micha19:05:18

which is not so great in practice

dm319:05:19

I only saw that when the its-alive repo got linked here

dm319:05:43

yeah, not arguing javelin needs it

alandipert19:05:02

tilton uses his cells for IO and stuff, in places where i'd use queues

alandipert19:05:10

so i think he wants them to do everything

alandipert19:05:18

vs. javelin which is focused on UI

alandipert19:05:42

well, to the degree that strict eval is the only one you need with UI, and to do effects with minimal fanfare

piotrek20:05:35

Hi, I have a hoplon elements design question

piotrek20:05:45

let me provide background first

piotrek20:05:14

I have a page (it’s quite common and general case) where I have a search/filter part and the results list part

piotrek20:05:00

I have my results list defined as defelem accepting result-list errors and loading cells and the list element is rendering based on the values in those cells

piotrek20:05:01

I also have a search part defined as defelem which has an attribute called search-criteria - it’s a cell passed from external code and the search view puts the criteria from its UI fields when the user clicks search button

piotrek20:05:13

now I wanted to glue those two elements together in my page

piotrek20:05:19

so I have something like that:

piotrek20:05:14

now the question is how should I make the changes in search-criteria cell to call (search search-criteria results-list errors loading) function which will fill the provided cells based on the criteria from search-criteria cell?

alandipert21:05:02

just published a little example showing how to mount hoplon elements into existing markup, https://github.com/alandipert/embedded-hoplon-example

raywillig21:05:55

hey @alandipert does a thing like that obviate splint?

alandipert22:05:55

@raywillig: maybe in some situations. Unfortunately not ours lol

raywillig22:05:43

yeah, i realized after that they’re probably solving different problems for the most part with maybe a little overlap