From 9fb5636a660c8512341750b0884b818b1c4cc6d2 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Fri, 2 Oct 2020 12:18:08 +0200 Subject: [PATCH 1/3] Fix 3DS iframe selection Stripe is now using random names for their iframe containers, so we need to resort to some other strategy for finding the iframe that contains the one named `__stripeJSChallengeFrame`. Currently, one reliable way to find this iframe is by using a non-changing part of its `src` attribute. --- spec/features/stripe_checkout_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/stripe_checkout_spec.rb b/spec/features/stripe_checkout_spec.rb index f0df05b9..5de64653 100644 --- a/spec/features/stripe_checkout_spec.rb +++ b/spec/features/stripe_checkout_spec.rb @@ -471,7 +471,7 @@ end def within_3d_secure_modal - within_frame "__privateStripeFrame11" do + within_frame find("iframe[src*='authorize-with-url-inner']") do within_frame "__stripeJSChallengeFrame" do within_frame "acsFrame" do yield From 2eb9fd4d693a6bfd39a1f10ff6ad5a3123d0816a Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Fri, 2 Oct 2020 13:17:11 +0200 Subject: [PATCH 2/3] Add `accept_alert` for Selenium We recently switched to Selenium so we need to add this command whenever an alert message is opened in the browser. --- spec/features/stripe_checkout_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/features/stripe_checkout_spec.rb b/spec/features/stripe_checkout_spec.rb index 5de64653..1f16f25e 100644 --- a/spec/features/stripe_checkout_spec.rb +++ b/spec/features/stripe_checkout_spec.rb @@ -271,7 +271,9 @@ expect(page).to have_content "Completed" end - find('input[value="Cancel"]').click + page.accept_alert do + find('input[value="Cancel"]').click + end expect(page).to have_content "Order canceled" @@ -396,7 +398,9 @@ expect(page).to have_content "Completed" end - find('input[value="Cancel"]').click + page.accept_alert do + find('input[value="Cancel"]').click + end expect(page).to have_content "Order canceled" From 89e5cf495d2a1f0f04e8e990ca70ac22b754004c Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Fri, 2 Oct 2020 14:20:36 +0200 Subject: [PATCH 3/3] Fix CI failure after solidusio/solidus#3761 In Solidus we changed the way we void payments. When the payment has zero amount we don't try to void anymore. --- .../solidus_stripe/create_intents_payment_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/solidus_stripe/create_intents_payment_service_spec.rb b/spec/models/solidus_stripe/create_intents_payment_service_spec.rb index cdc697ee..f14a278c 100644 --- a/spec/models/solidus_stripe/create_intents_payment_service_spec.rb +++ b/spec/models/solidus_stripe/create_intents_payment_service_spec.rb @@ -96,7 +96,7 @@ context "when there are previous pending payments" do let!(:payment) do - create(:payment, order: order).tap do |payment| + create(:payment, order: order, amount: order.total).tap do |payment| payment.update!(state: :pending) end end