Improve gateway fees tests

This commit is contained in:
Hillel Coren 2017-04-09 20:24:17 +03:00
parent 0f4ed61e36
commit 5f91c73e3b

View File

@ -56,8 +56,14 @@ class GatewayFeesCest
$this->configureGatewayFeeTax($I, $taxName, $taxRate);
$this->createInvoice($I, $clientName, $productKey, $total, $feeWithTax);
// partial invoice
// partial invoice (resaving invoice between payments)
$invitationKey = $this->createInvoice($I, $clientName, $productKey, $total, $partialFeeWithTax, $total / 2);
$invoiceId = $I->grabFromDatabase('invitations', 'invoice_id', ['invitation_key' => $invitationKey]);
$invoicePublicId = $I->grabFromDatabase('invoices', 'public_id', ['invoice_id' => $invoiceId]);
$I->amOnPage('/invoices/' . $invoicePublicId . '/edit');
$I->click('Save');
$I->wait(2);
$I->see('Successfully updated invoice');
$this->createPayment($I, $invitationKey, $total + $partialFeeWithTax, 0, $partialFeeWithTax);
}