From c808681ec321ef1e82b54bcb47a6f0c2a9cbe651 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 30 Mar 2017 15:23:07 +0300 Subject: [PATCH] Working on tests --- tests/acceptance/OnlinePaymentCest.php | 27 ++++++-------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/tests/acceptance/OnlinePaymentCest.php b/tests/acceptance/OnlinePaymentCest.php index d114189711..dde4ac2b6d 100644 --- a/tests/acceptance/OnlinePaymentCest.php +++ b/tests/acceptance/OnlinePaymentCest.php @@ -49,26 +49,6 @@ class OnlinePaymentCest $I->createOnlinePayment($I, $invitationKey); - /* - $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]); - $invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]); - - $clientSession = $I->haveFriend('client'); - $clientSession->does(function(AcceptanceTester $I) use ($invitationKey) { - $I->amOnPage('/view/' . $invitationKey); - $I->click('Pay Now'); - $I->click('Credit Card'); - $I->fillField('#card_number', '4242424242424242'); - $I->fillField('#cvv', '100'); - $I->selectOption('#expiration_month', 12); - $I->selectOption('#expiration_year', date('Y')); - $I->click('.btn-success'); - $I->wait(3); - $I->see('Successfully applied payment'); - }); - $I->wait(1); - */ - // create recurring invoice and auto-bill $I->amOnPage('/recurring_invoices/create'); $I->selectDropdown($I, 'Test Test', '.client_select .dropdown-toggle'); @@ -77,6 +57,11 @@ class OnlinePaymentCest $I->selectOption('#auto_bill', 3); $I->executeJS('onConfirmEmailClick()'); $I->wait(4); - $I->see("$0.00"); + + $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId, 'is_recurring' => true]); + $invoiceId = $I->grabFromDatabase('invoices', 'public_id', ['recurring_invoice_id' => $invoiceId]); + + $I->amOnPage("/invoices/{$invoiceId}/edit"); + $I->see('Successfully applied payment'); } }