From 6b4e6694622edaecb4c583af97333ba93670116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 18 Aug 2021 17:58:17 +0200 Subject: [PATCH] Tests: Payment with new credit card Payment with new credit card --- .../Gateways/Square/CreditCardTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Browser/ClientPortal/Gateways/Square/CreditCardTest.php b/tests/Browser/ClientPortal/Gateways/Square/CreditCardTest.php index bd8087476fec..ec9e08addea1 100644 --- a/tests/Browser/ClientPortal/Gateways/Square/CreditCardTest.php +++ b/tests/Browser/ClientPortal/Gateways/Square/CreditCardTest.php @@ -32,4 +32,25 @@ class CreditCardTest extends DuskTestCase ->auth(); }); } + + public function testPaymentWithNewCard() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->click('@pay-now-dropdown') + ->clickLink('Credit Card') + ->type('#cardholder-name', 'John Doe') + ->withinFrame('iframe', function (Browser $browser) { + $browser + ->type('#cardNumber', '4111 1111 1111 1111') + ->type('#expirationDate', '04/22') + ->type('#cvv', '1111') + ->type('#postalCode', '12345'); + }) + ->click('#pay-now') + ->waitForText('Details of the payment', 60); + }); + } }