From 498ad19a631d18d29ca9750d278e29f836b6c63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 7 Jul 2021 13:10:45 +0200 Subject: [PATCH] Gateways: Stripe: Pay with new card and save for future use --- .../Gateways/Stripe/CreditCardTest.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php index 4becee0fed79..4a21a298ab45 100644 --- a/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php +++ b/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php @@ -61,4 +61,28 @@ class CreditCardTest extends DuskTestCase ->waitForText('Details of the payment'); }); } + + public function testPayWithNewCardAndSaveForFutureUse() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->click('@pay-now-dropdown') + ->click('@pay-with-1') + ->type('#cardholder-name', 'John Doe') + ->withinFrame('iframe', function (Browser $browser) { + $browser + ->type('cardnumber', '4242 4242 4242 4242') + ->type('exp-date', '04/22') + ->type('cvc', '242'); + }) + ->radio('#proxy_is_default', true) + ->click('#pay-now') + ->waitForText('Details of the payment') + ->visitRoute('client.payment_methods.index') + ->clickLink('View') + ->assertSee('4242'); + }); + } }