Started working on test script
This commit is contained in:
125
project.clj
125
project.clj
@@ -106,68 +106,83 @@
|
||||
"fig:min" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "min"]}
|
||||
|
||||
|
||||
:profiles
|
||||
{:dev
|
||||
{:resource-paths ["resources" "target"]
|
||||
:dependencies [[binaryage/devtools "1.0.2"]
|
||||
[postgresql/postgresql "9.3-1102.jdbc41"]
|
||||
[org.clojure/java.jdbc "0.7.11"]
|
||||
[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||
ring
|
||||
ring/ring-core
|
||||
ring/ring-codec
|
||||
ring/ring-defaults
|
||||
ring/ring-devel
|
||||
org.clojure/tools.cli
|
||||
binaryage/devtools
|
||||
commons-io
|
||||
commons-codec
|
||||
com.fasterxml.jackson.core/jackson-core
|
||||
org.clojure/tools.namespace
|
||||
org.eclipse.jetty.websocket/websocket-server
|
||||
org.eclipse.jetty.websocket/websocket-servlet
|
||||
args4j]]
|
||||
[com.bhauman/rebel-readline-cljs "0.1.4" :exclusions [org.clojure/clojurescript]]
|
||||
[javax.servlet/servlet-api "2.5"]]
|
||||
:plugins [[lein-pdo "0.1.1"]]
|
||||
:jvm-opts ["-Dconfig=config/dev.edn" "-Dlogback.configurationFile=logback.xml"]}
|
||||
|
||||
:profiles {
|
||||
:dev
|
||||
{:resource-paths ["resources" "target"]
|
||||
:dependencies [[binaryage/devtools "1.0.2"]
|
||||
[postgresql/postgresql "9.3-1102.jdbc41"]
|
||||
[org.clojure/java.jdbc "0.7.11"]
|
||||
[etaoin "0.4.1"]
|
||||
[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||
ring
|
||||
ring/ring-core
|
||||
ring/ring-codec
|
||||
ring/ring-defaults
|
||||
ring/ring-devel
|
||||
org.clojure/tools.cli
|
||||
binaryage/devtools
|
||||
commons-io
|
||||
commons-codec
|
||||
com.fasterxml.jackson.core/jackson-core
|
||||
org.clojure/tools.namespace
|
||||
org.eclipse.jetty.websocket/websocket-server
|
||||
org.eclipse.jetty.websocket/websocket-servlet
|
||||
args4j]]
|
||||
[com.bhauman/rebel-readline-cljs "0.1.4" :exclusions [org.clojure/clojurescript]]
|
||||
[javax.servlet/servlet-api "2.5"]]
|
||||
:plugins [[lein-pdo "0.1.1"]]
|
||||
:jvm-opts ["-Dconfig=config/dev.edn" "-Dlogback.configurationFile=logback.xml"]}
|
||||
|
||||
|
||||
:uberjar {:prep-tasks ["fig:min" ]
|
||||
:dependencies [[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||
ring
|
||||
ring/ring-core
|
||||
ring/ring-codec
|
||||
ring/ring-defaults
|
||||
ring/ring-devel
|
||||
org.clojure/tools.cli
|
||||
ring.adapter.jetty
|
||||
binaryage/devtools
|
||||
commons-io
|
||||
commons-codec
|
||||
com.fasterxml.jackson.core/jackson-core
|
||||
org.clojure/tools.namespace
|
||||
org.eclipse.jetty.websocket/websocket-server
|
||||
org.eclipse.jetty.websocket/websocket-servlet
|
||||
args4j]]]}
|
||||
:provided {:dependencies [[org.clojure/clojurescript "1.10.773"
|
||||
:exclusions [com.google.code.findbugs/jsr305
|
||||
com.fasterxml.jackson.core/jackson-core]]
|
||||
[reagent "1.0.0" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server] ]
|
||||
[re-frame "1.1.2"
|
||||
:exclusions
|
||||
[reagent
|
||||
org.clojure/clojurescript]]
|
||||
[re-frame-utils "0.1.0"]
|
||||
[com.andrewmcveigh/cljs-time "0.5.2"]
|
||||
[cljs-http "0.1.46"]
|
||||
[kibu/pushy "0.3.8"]]}}
|
||||
:uberjar
|
||||
{:prep-tasks ["fig:min" ]
|
||||
:dependencies [[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
||||
ring
|
||||
ring/ring-core
|
||||
ring/ring-codec
|
||||
ring/ring-defaults
|
||||
ring/ring-devel
|
||||
org.clojure/tools.cli
|
||||
ring.adapter.jetty
|
||||
binaryage/devtools
|
||||
commons-io
|
||||
commons-codec
|
||||
com.fasterxml.jackson.core/jackson-core
|
||||
org.clojure/tools.namespace
|
||||
org.eclipse.jetty.websocket/websocket-server
|
||||
org.eclipse.jetty.websocket/websocket-servlet
|
||||
args4j]]]}
|
||||
:provided {:dependencies [[org.clojure/clojurescript "1.10.773"
|
||||
:exclusions [com.google.code.findbugs/jsr305
|
||||
com.fasterxml.jackson.core/jackson-core]]
|
||||
[reagent "1.0.0" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server] ]
|
||||
[re-frame "1.1.2"
|
||||
:exclusions
|
||||
[reagent
|
||||
org.clojure/clojurescript]]
|
||||
[re-frame-utils "0.1.0"]
|
||||
[com.andrewmcveigh/cljs-time "0.5.2"]
|
||||
[cljs-http "0.1.46"]
|
||||
[kibu/pushy "0.3.8"]]}
|
||||
|
||||
}
|
||||
|
||||
: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]
|
||||
|
||||
: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"])
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
(client-override i)
|
||||
(:name client))])
|
||||
[grid/cell {} (:name vendor)]
|
||||
[glast-updatedrid/cell {} invoice-number]
|
||||
[grid/cell {} invoice-number]
|
||||
[grid/cell {} (date->str date) ]
|
||||
[grid/cell {}
|
||||
(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]
|
||||
[auto-ap.datomic.migrate :as m]
|
||||
[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]
|
||||
[auto-ap.datomic :refer [uri conn]]
|
||||
[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]
|
||||
[auto-ap.yodlee.core :as c]
|
||||
[datomic.api :as d]
|
||||
Reference in New Issue
Block a user