Started working on test script
This commit is contained in:
23
project.clj
23
project.clj
@@ -106,12 +106,13 @@
|
|||||||
"fig:min" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "min"]}
|
"fig:min" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "min"]}
|
||||||
|
|
||||||
|
|
||||||
:profiles
|
:profiles {
|
||||||
{:dev
|
:dev
|
||||||
{:resource-paths ["resources" "target"]
|
{:resource-paths ["resources" "target"]
|
||||||
:dependencies [[binaryage/devtools "1.0.2"]
|
:dependencies [[binaryage/devtools "1.0.2"]
|
||||||
[postgresql/postgresql "9.3-1102.jdbc41"]
|
[postgresql/postgresql "9.3-1102.jdbc41"]
|
||||||
[org.clojure/java.jdbc "0.7.11"]
|
[org.clojure/java.jdbc "0.7.11"]
|
||||||
|
[etaoin "0.4.1"]
|
||||||
[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||||
ring
|
ring
|
||||||
ring/ring-core
|
ring/ring-core
|
||||||
@@ -133,7 +134,8 @@
|
|||||||
:jvm-opts ["-Dconfig=config/dev.edn" "-Dlogback.configurationFile=logback.xml"]}
|
:jvm-opts ["-Dconfig=config/dev.edn" "-Dlogback.configurationFile=logback.xml"]}
|
||||||
|
|
||||||
|
|
||||||
:uberjar {:prep-tasks ["fig:min" ]
|
:uberjar
|
||||||
|
{:prep-tasks ["fig:min" ]
|
||||||
:dependencies [[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
:dependencies [[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||||
ring
|
ring
|
||||||
ring/ring-core
|
ring/ring-core
|
||||||
@@ -161,13 +163,26 @@
|
|||||||
[re-frame-utils "0.1.0"]
|
[re-frame-utils "0.1.0"]
|
||||||
[com.andrewmcveigh/cljs-time "0.5.2"]
|
[com.andrewmcveigh/cljs-time "0.5.2"]
|
||||||
[cljs-http "0.1.46"]
|
[cljs-http "0.1.46"]
|
||||||
[kibu/pushy "0.3.8"]]}}
|
[kibu/pushy "0.3.8"]]}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
:main auto-ap.server
|
:main auto-ap.server
|
||||||
|
|
||||||
:aot [auto-ap.server auto-ap.datomic.migrate auto-ap.time clj-time.core clj-time.coerce clj-time.format clojure.tools.logging.impl]
|
:aot [auto-ap.server auto-ap.datomic.migrate auto-ap.time clj-time.core clj-time.coerce clj-time.format clojure.tools.logging.impl]
|
||||||
|
|
||||||
:uberjar-name "auto-ap.jar"
|
:uberjar-name "auto-ap.jar"
|
||||||
|
:test-paths ["test/clj"]
|
||||||
|
:test-selectors {:integration (fn [m]
|
||||||
|
(or (clojure.string/includes? (str (:ns m))
|
||||||
|
"integration")
|
||||||
|
(clojure.string/includes? (str (:name m))
|
||||||
|
"integration")))
|
||||||
|
:functional (fn [m]
|
||||||
|
(or (clojure.string/includes? (str (:ns m))
|
||||||
|
"functional")
|
||||||
|
(clojure.string/includes? (str (:name m))
|
||||||
|
"functional")))}
|
||||||
|
|
||||||
:prep-tasks [ "compile"])
|
:prep-tasks [ "compile"])
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
(client-override i)
|
(client-override i)
|
||||||
(:name client))])
|
(:name client))])
|
||||||
[grid/cell {} (:name vendor)]
|
[grid/cell {} (:name vendor)]
|
||||||
[glast-updatedrid/cell {} invoice-number]
|
[grid/cell {} invoice-number]
|
||||||
[grid/cell {} (date->str date) ]
|
[grid/cell {} (date->str date) ]
|
||||||
[grid/cell {}
|
[grid/cell {}
|
||||||
(when due
|
(when due
|
||||||
|
|||||||
52
test/clj/auto_ap/functional/test.clj
Normal file
52
test/clj/auto_ap/functional/test.clj
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
(ns auto-ap.functional.test
|
||||||
|
(:require [clojure.test :as t :refer :all]
|
||||||
|
[etaoin.api :as e]
|
||||||
|
[etaoin.keys :as k]
|
||||||
|
[config.core :refer [env]]
|
||||||
|
[clj-time.core :as time]
|
||||||
|
[buddy.sign.jwt :as jwt]))
|
||||||
|
|
||||||
|
(def base-url "https://staging3.app.integreatconsult.com")
|
||||||
|
(defn login-admin [driver]
|
||||||
|
(let [jwt-token (jwt/sign {:user "Automated Tests"
|
||||||
|
:exp (time/plus (time/now) (time/days 30))
|
||||||
|
:user/role "admin"
|
||||||
|
:user/name "Automated Tests"}
|
||||||
|
(:jwt-secret env)
|
||||||
|
{:alg :hs512})]
|
||||||
|
(e/go driver (str base-url "/?jwt=" jwt-token))
|
||||||
|
(e/wait-visible driver {:tag :h1
|
||||||
|
:class "title"})))
|
||||||
|
|
||||||
|
(deftest create-invoice
|
||||||
|
(testing "Creating a new invoice"
|
||||||
|
(e/with-wait-timeout 10
|
||||||
|
(e/with-firefox {} driver
|
||||||
|
(login-admin driver)
|
||||||
|
(e/click driver {:tag :a :fn/text "Invoices"})
|
||||||
|
(e/wait-visible driver {:tag :h1
|
||||||
|
:class "title"
|
||||||
|
:fn/text "Unpaid Invoices"})))))
|
||||||
|
|
||||||
|
|
||||||
|
(deftest edit-client
|
||||||
|
(testing "Editing a client"
|
||||||
|
(e/with-wait-timeout 10
|
||||||
|
(e/with-firefox {} driver
|
||||||
|
(login-admin driver)
|
||||||
|
|
||||||
|
(e/click driver {:tag :a :class "navbar-link login"})
|
||||||
|
(e/click driver {:tag :a :fn/text "Administration"})
|
||||||
|
|
||||||
|
(e/wait-visible driver {:tag :h1
|
||||||
|
:class "title"
|
||||||
|
:fn/text "Admin"})
|
||||||
|
(e/click driver {:tag :span :fn/text "Clients"})
|
||||||
|
(e/wait-visible driver {:tag :h1
|
||||||
|
:class "title"
|
||||||
|
:fn/text "Clients"})
|
||||||
|
(e/click driver {:tag :i :class "fa fa-pencil"})
|
||||||
|
(e/wait-visible driver {:tag :button
|
||||||
|
:fn/text "Save"})
|
||||||
|
(e/click driver {:tag :button :fn/text "Save"})
|
||||||
|
(e/wait-invisible driver {:tag :form})))))
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
(ns test.auto-ap.graphql
|
(ns auto-ap.integration.graphql
|
||||||
(:require [auto-ap.graphql :as sut]
|
(:require [auto-ap.graphql :as sut]
|
||||||
[auto-ap.datomic.migrate :as m]
|
[auto-ap.datomic.migrate :as m]
|
||||||
[venia.core :as v]
|
[venia.core :as v]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
(ns clj.auto-ap.graphql.vendors
|
(ns auto-ap.integration.graphql.vendors
|
||||||
(:require [auto-ap.graphql.vendors :as sut2]
|
(:require [auto-ap.graphql.vendors :as sut2]
|
||||||
[auto-ap.datomic :refer [uri conn]]
|
[auto-ap.datomic :refer [uri conn]]
|
||||||
[auto-ap.datomic.migrate :as m]
|
[auto-ap.datomic.migrate :as m]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
(ns test.auto-ap.yodlee.import
|
(ns auto-ap.integration.yodlee.import
|
||||||
(:require [auto-ap.yodlee.import :as sut]
|
(:require [auto-ap.yodlee.import :as sut]
|
||||||
[auto-ap.yodlee.core :as c]
|
[auto-ap.yodlee.core :as c]
|
||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
Reference in New Issue
Block a user