From 4705d40fdb2c9378a4d1bec860d311ff08391a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 7 Jul 2021 13:46:37 +0200 Subject: [PATCH] Gateways: Stripe: Adding credit card standalone --- .../Gateways/Stripe/CreditCardTest.php | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php index 1fc2c5152d0a..ce9be588c762 100644 --- a/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php +++ b/tests/Browser/ClientPortal/Gateways/Stripe/CreditCardTest.php @@ -58,9 +58,9 @@ class CreditCardTest extends DuskTestCase ->type('cvc', '242'); }) ->click('#pay-now') - ->waitForText('Details of the payment'); + ->waitForText('Details of the payment', 60); }); - } + } public function testPayWithNewCardAndSaveForFutureUse() { @@ -79,7 +79,7 @@ class CreditCardTest extends DuskTestCase }) ->radio('#proxy_is_default', true) ->click('#pay-now') - ->waitForText('Details of the payment') + ->waitForText('Details of the payment', 60) ->visitRoute('client.payment_methods.index') ->clickLink('View') ->assertSee('4242'); @@ -96,7 +96,7 @@ class CreditCardTest extends DuskTestCase ->click('@pay-with-1') ->click('.toggle-payment-with-token') ->click('#pay-now') - ->waitForText('Details of the payment'); + ->waitForText('Details of the payment', 60); }); } @@ -112,4 +112,23 @@ class CreditCardTest extends DuskTestCase ->assertSee('Payment method has been successfully removed.'); }); } + + public function testAddingCreditCardStandalone() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.payment_methods.index') + ->press('Add Payment Method') + ->clickLink('Credit Card') + ->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'); + }) + ->press('Add Payment Method') + ->waitForText('**** 4242'); + }); + } }