Started working on test script

This commit is contained in:
Bryce Covert
2020-12-28 09:41:39 -08:00
parent 41660226cc
commit 1d1f8e220c
6 changed files with 126 additions and 59 deletions

View 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})))))

View File

@@ -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]

View File

@@ -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]

View File

@@ -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]