diff --git a/tests/Browser/ClientPortal/Gateways/CheckoutCom/CreditCardTest.php b/tests/Browser/ClientPortal/Gateways/CheckoutCom/CreditCardTest.php index cbfafa562527..a86b533b4010 100644 --- a/tests/Browser/ClientPortal/Gateways/CheckoutCom/CreditCardTest.php +++ b/tests/Browser/ClientPortal/Gateways/CheckoutCom/CreditCardTest.php @@ -44,7 +44,7 @@ class CreditCardTest extends DuskTestCase }); } - public function testPayingWithNewCard() + public function testPayWithNewCard() { $this->browse(function (Browser $browser) { $browser @@ -62,4 +62,27 @@ class CreditCardTest extends DuskTestCase ->waitForText('Details of the payment', 60); }); } + + public function testPayWithNewCardAndSaveForFutureUse() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('Credit Card') + ->withinFrame('iframe', function (Browser $browser) { + $browser + ->type('cardnumber', '4242424242424242') + ->type('exp-date', '04/22') + ->type('cvc', '100'); + }) + ->radio('#proxy_is_default', true) + ->press('#pay-button') + ->waitForText('Details of the payment', 60) + ->visitRoute('client.payment_methods.index') + ->clickLink('View') + ->assertSee('4242'); + }); + } }