Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.
 
 

Repository files navigation

kamera

Forked version of Kamera to work without figwheel (for example in a shadow-cljs project)

usage

(ns my-app.cards-test
  (:require [clojure.test :as t]
            [shadow.cljs.devtools.api :as shadow]
            [shadow.cljs.devtools.server :as server]
            [kamera.devcards :as kam]
            [kamera.core :as k]))

(t/deftest test-all-cards
  (t/testing "Compare devcards to reference images"
    (do
      (server/start!)
      (shadow/watch :cards)
      (let [card-results (k/with-chrome-session {}
                           (fn [session]
                             (kam/test-devcards
                              "http://localhost:1337/cards.html"
                              session
                              nil
                              (assoc-in k/default-opts [:default-target :metric-threshold] 0.001))))]
        (for [card card-results]
          (t/is (< (:metric card) (:metric-threshold card))))))))

Build

# generate js, used in report pages
clj -M --main cljs.main --output-to resources/public/kamera.js --optimizations advanced -c kamera.app

# generate css for report pages
sassc resources/sass/kamera.scss ./resources/public/css/kamera.css

License

Copyright © 2018 oliyh

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

UI testing via image comparison and devcards

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages