Test 3d secure auth bypassing web-mock - #3
Conversation
| (is (= (:payment_method payment-intent) (:id payment-method))) | ||
| (is (= (:type (:next_action payment-intent)) "redirect_to_url"))))) | ||
| (do | ||
| (def driver (create-driver {:driver-type :firefox :driver-args ["--headless"]})) |
There was a problem hiding this comment.
This can go in the let above.
| (is (= (:currency payment-intent) "gbp")) | ||
| (is (= (:payment_method payment-intent) (:id payment-method))) | ||
| (is (= (:type (:next_action payment-intent)) "redirect_to_url"))))) | ||
| (do |
There was a problem hiding this comment.
There's no need for a do here. The body of a let is an implicit do.
| (to driver (:url (:redirect_to_url (:next_action payment-intent)))) | ||
| (wait-for-element driver :name "__privateStripeFrame4") | ||
| (iframe driver "__privateStripeFrame4") | ||
| (wait-for-element driver :name "stripe-challenge-frame") | ||
| (iframe driver "stripe-challenge-frame") | ||
| (send-keys (wait-for-element driver :xpath "//*[@id=\"test-source-authorize-3ds\"]") (. org.openqa.selenium.Keys ENTER))) | ||
| (Thread/sleep 500) |
There was a problem hiding this comment.
The strategy of using a firefox webdriver for this is going to make it difficult to run these tests in a deployment pipeline. Maybe look at using htmlunit-driver.
There was a problem hiding this comment.
Thanks Toby, will take a look.
There was a problem hiding this comment.
PR is not doable because we encountered problems described in here:
https://stackoverflow.com/questions/20315330/how-to-overcome-an-htmlunit-scriptexception
TL;DR: 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 t seems to be the most robust "browser as a lib" tool.
We push the changes for error demo purposes
& amount-received Authors: @callwait @ShanaSkydancer
Adds basic invoice functionality
Adds invoices to core
Adds refunds to core and associated functionality
Adds handling for if charges are null on a payment intent
Adds more fields to refunds
Add field total to invoices
No description provided.