Skip to content

Commit

Permalink
Ready to show htmlUnit error
Browse files Browse the repository at this point in the history
HtmlUnit can break easily with javascript tweaks, even with minimization. Its is happening in the 3DS automating part

We tried:

    Different browsers versions in the library
    Deactivate javascript
    Deactivate image downloading
    Deactivate error messages

None of them worked for HtmlUnit and seems to be the most robust "browser as a lib" tool.
  • Loading branch information
WencesLlobet committed Jun 18, 2020
1 parent 7cd8fff commit 2540da0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.9.0"]
[com.stripe/stripe-java "19.12.0"]
[webdriver "0.15.0"]]
[webdriver "0.15.0"]
[org.seleniumhq.selenium/htmlunit-driver "2.41.0"]]

:plugins [[jonase/eastwood "0.2.5"]
[lein-eftest "0.5.3"]
[lein-changelog "0.3.2"]
Expand Down
5 changes: 4 additions & 1 deletion test/zebra/payment_intents_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
[zebra.payment-methods :as payment-methods]
[zebra.payment-intents :as payment-intent]
[webdriver.core :refer :all]
[zebra.helpers.constants :refer [api-key tokens]]))
[zebra.helpers.constants :refer [api-key tokens]])
(:import (org.openqa.selenium.htmlunit HtmlUnitDriver)
(com.gargoylesoftware.htmlunit BrowserVersion)))


(deftest create-payment-intent
Expand Down Expand Up @@ -68,6 +70,7 @@
api-key)]

(do
;(def driver {:driver (new HtmlUnitDriver BrowserVersion/BEST_SUPPORTED true)})
(def driver (create-driver {:driver-type :firefox :driver-args ["--headless"]}))
(to driver (:url (:redirect_to_url (:next_action payment-intent))))
(wait-for-element driver :name "__privateStripeFrame4")
Expand Down

0 comments on commit 2540da0

Please sign in to comment.