Giter VIP home page Giter VIP logo

doo-chrome-devprotocol's Introduction

doo-chrome-devprotocol

A runner for doo which runs tests in Chrome, using the Chrome Dev Protocol with no need for karma or npm.

Clojars Project

Usage

(require '[doo-chrome-devprotocol.core :as dc])

(dc/run "path/to/doo-tests.js")

;; => {:success? true
       :report {:tests 2
                :assertions 4
                :failures 0
                :errors 0}}

run also takes an optional map of options which should be self-explanatory

{:port                  8899
 :chrome-path           "/usr/bin/chromium"
 :chrome-args           ["--headless"
                         "--disable-gpu" ;; recommended on windows
                        ]
 :chrome-launch-timeout 5000
 :doo-message-prefix    "doo:"
 :document-load-timeout 60000
 :doo-load-timeout      10000
 :doo-run-timeout       60000}

Integration with clojure.test

(ns my-project.runner
  (:require [doo-chrome-devprotocol.core :as dc]
            [clojure.test :refer [deftest is]]))

(def doo-args
  {:chrome-args ["--headless" "--disable-gpu" "--no-sandbox"]})

(deftest cljs-tests
  (let [result (dc/run "out/unit-test.js" doo-args)]
    (is (:success? result) (:report result))))

Development

CircleCI

License

Copyright © 2018 oliyh

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

doo-chrome-devprotocol's People

Contributors

oliyh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

doo-chrome-devprotocol's Issues

Needs to work with async tests

Wait for the exit to happen rather than assuming it happens synchronously. Probably log some special message which delivers a promise on the Java side.

osx java8

Nice job Oliy, but I can't use it at present as it blows up on my mac - looks like it requires Java 9:

CdpException mac os x is not supported by AdaptiveProcessManager  io.webfolder.cdp.AdaptiveProcessManager.<init> (AdaptiveProcessManager.java:46)

I traced it down to https://github.com/webfolderio/cdp4j/issues/95

How do you run these on CI? would you wrap this up inside a clojure.test/deftest and run it as part of lein test? it would be cool to see an example.

With a bit/lot of work around test reporting we could potentially start running cljs tests in emacs with some decent output, as per standard clojure tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.