From 8fe01cec864d03e1d35c387f42bb267e0df249b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 12 Jul 2021 13:32:34 +0200 Subject: [PATCH] Gateways: WePay: Credit card: Pay with new card and save for future use --- .../Gateways/WePay/CreditCardTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Browser/ClientPortal/Gateways/WePay/CreditCardTest.php b/tests/Browser/ClientPortal/Gateways/WePay/CreditCardTest.php index b0312e2af330..38b3968b3533 100644 --- a/tests/Browser/ClientPortal/Gateways/WePay/CreditCardTest.php +++ b/tests/Browser/ClientPortal/Gateways/WePay/CreditCardTest.php @@ -54,4 +54,25 @@ 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') + ->type('card-number', '4003830171874018') + ->type('card-holders-name', 'John Doe') + ->type('.expiry', '12/28') + ->type('cvc', '100') + ->radio('#proxy_is_default', true) + ->press('Pay Now') + ->waitForText('Details of the payment', 60) + ->visitRoute('client.payment_methods.index') + ->clickLink('View') + ->assertSee('4018'); + }); + } }