use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class LoanTestHelper method verifyNoPeriodicFee.
public void verifyNoPeriodicFee(String expectedFee, int feeIndex) {
LoanAccountPage loanAccountPage = new LoanAccountPage(selenium);
loanAccountPage.verifyPeriodicFeeExists(expectedFee, feeIndex);
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ApplyPaymentOnGLIMLoanAccountTest method checkApplyPaymentOnGLIMLoanAccount.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkApplyPaymentOnGLIMLoanAccount() throws Exception {
LoanAccountPage loanAccountPage = createNewLoan();
AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
params.setNote("asd");
params.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("04");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.setAmount("140");
applyGroupPaymentPage.verifyIndividualAmount(0, "20.0");
applyGroupPaymentPage.verifyIndividualAmount(1, "40.0");
applyGroupPaymentPage.verifyIndividualAmount(2, "80.0");
//principal 25, less
applyGroupPaymentPage.setIndividualAmount(0, "20");
//principal 50, equal
applyGroupPaymentPage.setIndividualAmount(1, "50");
//principal 100, more
applyGroupPaymentPage.setIndividualAmount(2, "120");
applyGroupPaymentPage.verifyAmount("190");
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentPage.setDate("04", "03", "2011");
ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, EXPECTED_PAID_INSTALLMENTS);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
for (int i = 0; i <= 2; i += 1) {
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, INDIVIDUAL_EXPECTED_PAID_INSTALLMENTS[i]);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
}
// Test applying payment for last installment
applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentPage.setAmount("1500");
applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
// Last installment left to payoff whole account
applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.verifyAmount("60.0");
applyGroupPaymentPage.verifyIndividualAmount(0, "15.7");
applyGroupPaymentPage.verifyIndividualAmount(1, "21.4");
applyGroupPaymentPage.verifyIndividualAmount(2, "22.9");
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class CreateGLIMLoanAccountWithOneTimeFeeTest method checkGLIMLoanWithThreeClientsCreeatedCorrectly.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMLoanWithThreeClientsCreeatedCorrectly() throws Exception {
LoanAccountPage loanAccountPage = createLoan();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("10");
loanAccountPage.verifyDisbursalDate("04/03/2011");
loanAccountPage.verifyPrincipalOriginal("1,000");
loanAccountPage.verifyLoanTotalBalance("1,043");
loanAccountPage.verifyFeesOriginal("1");
loanAccountPage.verifyInterestOriginal("42");
Assert.assertTrue(selenium.isTextPresent("oneTimeFee: 1"));
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS, EXPECTED_INTERESTS, EXPECTED_FEES, EXPECTED_TOTALS);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
params.setNote("asd");
params.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("04");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(0).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT1, EXPECTED_INTERESTS_CLIENT1, EXPECTED_FEES_CLIENT1, EXPECTED_TOTALS_CLIENT1);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(1).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT2, EXPECTED_INTERESTS_CLIENT2, EXPECTED_FEES_CLIENT2, EXPECTED_TOTALS_CLIENT2);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(2).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT3, EXPECTED_INTERESTS_CLIENT3, EXPECTED_FEES_CLIENT3, EXPECTED_TOTALS_CLIENT3);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
loanAccountPage = clientRepayLoan(loanAccountPage, 0);
loanAccountPage = clientRepayLoan(loanAccountPage, 1);
loanAccountPage = clientRepayLoan(loanAccountPage, 2);
loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class CreateGLIMLoanAccountWithOneTimeFeeTest method clientRepayLoan.
private LoanAccountPage clientRepayLoan(LoanAccountPage loanAccountPage, int clientIndex) {
LoanAccountPage individualLoanAccountPage = loanAccountPage.navigateToIndividualLoanAccountPage(clientIndex);
String loanId = individualLoanAccountPage.getAccountId();
String totalBalance = individualLoanAccountPage.getTotalBalance();
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setPaymentType(PaymentParameters.CASH);
paymentParams.setTransactionDateDD("04");
paymentParams.setTransactionDateMM("03");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setAmount(totalBalance);
loanAccountPage = loanTestHelper.applyGroupIndividualClientPayment(loanId, paymentParams);
loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
return loanAccountPage.navigateToGroupLoanPageFromIndividualLoanPage();
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class BatchJobPenaltyTest method createWeeklyLoanAccountWithPenalty.
private String createWeeklyLoanAccountWithPenalty(final String penaltyName) throws Exception {
final SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
formParameters.addPenalty(penaltyName);
formParameters.setDefaultLoanAmount("4500");
formParameters.setInterestTypes(SubmitFormParameters.FLAT);
formParameters.setMinInterestRate("0");
formParameters.setMaxInterestRate("0");
formParameters.setDefaultInterestRate("0");
formParameters.setMaxInstallments("10");
formParameters.setDefInstallments("10");
LoanAccountPage loanAccountPage = penaltyHelper.createWeeklyLoanAccountWithPenalty(formParameters, "Client - Veronica Abisya", true);
PaymentParameters formPayment = new PaymentParameters();
formPayment.setTransactionDateDD("15");
formPayment.setTransactionDateMM("2");
formPayment.setTransactionDateYYYY("2012");
formPayment.setAmount("450");
formPayment.setPaymentType(PaymentParameters.CASH);
loanAccountPage.navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(formPayment).submitAndNavigateToLoanAccountDetailsPage();
penaltyHelper.verifyCalculatePenaltyWithPayment(loanAccountPage.getAccountId(), new String[] { "0", "0", "0" }, new String[][] { { "0", "450" }, null, /* Future Installments */
{ "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" }, { "0", "450" } }, new String[] { "0", "16/02/2012", "0" });
return loanAccountPage.getAccountId();
}
Aggregations