use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ProperLoanProductCalculationsTest method verifyProperInterestAndPaymentMonthlyDecliningFixedProduct.
/**
* Declining fixed principal fixed payment type monthly loan calculates and
* displays proper interest and payment information.
* http://mifosforge.jira.com/browse/MIFOSTEST-67
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProperInterestAndPaymentMonthlyDecliningFixedProduct() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getMonthlyLoanProductParameters();
String productName = "LoanProduct" + StringUtil.getRandomString(5);
productParams.setOfferingName(productName);
productParams.setOfferingShortName(StringUtil.getRandomString(4));
productParams.setDefaultInterestRate("19.9");
productParams.setMaxInterestRate("50");
productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE_EPI);
productParams.setDefaultLoanAmount("57199");
productParams.setDefInstallments("32");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Client - Mary Monthly");
searchParams.setLoanProduct(productName);
loanProductTestHelper.defineNewLoanProduct(productParams);
LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
loanAccountPage.verifyPrincipalOriginal("57,199");
loanAccountPage.verifyInterestOriginal("15,652");
loanAccountPage.verifyFeesOriginal("0");
loanAccountPage.verifyPenaltyOriginal("0");
loanAccountPage.verifyTotalOriginalLoan("72851.0");
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ProperLoanProductCalculationsTest method verifyProperInterestAndPaymentWeeklyFlatProduct.
/**
* Flat interest rate weekly loan calculates and displays proper interest and payment information.
* http://mifosforge.jira.com/browse/MIFOSTEST-63
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProperInterestAndPaymentWeeklyFlatProduct() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
String productName = "LoanProduct" + StringUtil.getRandomString(5);
productParams.setOfferingName(productName);
productParams.setOfferingShortName(StringUtil.getRandomString(4));
productParams.setDefaultInterestRate("36");
productParams.setMaxInterestRate("50");
productParams.setInterestTypes(SubmitFormParameters.FLAT);
productParams.setDefaultLoanAmount("2500");
productParams.setDefInstallments("11");
loanProductTestHelper.defineNewLoanProduct(productParams);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233266063395 Client1233266063395");
searchParams.setLoanProduct(productName);
LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
loanAccountPage.verifyPrincipalOriginal("2,500");
loanAccountPage.verifyInterestOriginal("190");
loanAccountPage.verifyFeesOriginal("0");
loanAccountPage.verifyPenaltyOriginal("0");
loanAccountPage.verifyTotalOriginalLoan("2690.0");
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ApplyChargeGroupLoanTest method applyMiscPenalty.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyMiscPenalty() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null));
glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
String loanId = loanAccountPage.getAccountId();
String penaltyAmount = "100";
List<String> individualPenaltyAmounts = new ArrayList<String>();
individualPenaltyAmounts.add("20");
individualPenaltyAmounts.add("80");
ChargeParameters params = new ChargeParameters();
params.setType(ChargeParameters.MISC_PENALTY);
params.setAmount(penaltyAmount);
params.setGroupLoanIndividualAmounts(individualPenaltyAmounts);
loanAccountPage = loanTestHelper.applyChargeToGroupLoan(loanId, params);
verifyPenaltySummaryAndActivity(loanAccountPage, penaltyAmount, "Misc penalty applied", 2);
verifyRepaymentSchedulePage(loanAccountPage, penaltyAmount);
for (int i = 0; i < glimClients.size(); i++) {
LoanAccountPage individualLoanAccountPage = loanAccountPage.navigateToIndividualLoanAccountPageFromPendingApprovalGroupLoan(i);
verifyPenaltySummaryAndActivity(individualLoanAccountPage, individualPenaltyAmounts.get(i), "Misc penalty applied", 2);
verifyRepaymentSchedulePage(individualLoanAccountPage, individualPenaltyAmounts.get(i));
individualLoanAccountPage.navigateToGroupLoanPageFromIndividualLoanPage();
}
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ViewOriginalLoanScheduleTest method createLoanAccount.
private void createLoanAccount(DateTime creationDisbursalDate, DateTime actualDisbursalDate, boolean needApplyFee) throws UnsupportedEncodingException {
navigationHelper.navigateToHomePage();
loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(creationDisbursalDate).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
if (needApplyFee) {
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
}
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
loanTestHelper.approveLoan();
loanTestHelper.disburseLoan(actualDisbursalDate);
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ViewOriginalLoanScheduleTest method verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn.
@Test(enabled = true)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn() throws Exception {
int interestType = DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION;
applicationDatabaseOperation.updateLSIM(1);
createLoanProduct(interestType, false);
navigationHelper.navigateToHomePage();
loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(systemDateTime.plusDays(1)).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
loanTestHelper.approveLoan();
loanTestHelper.disburseLoan(systemDateTime);
String[][] tableOnOriginalInstallment = OriginalScheduleData.DEC_BAL_INT_RECALC_LOAN_EARLY_DISBURSAL_SCHEDULE_ON;
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.makePayment(systemDateTime.plusDays(15), "100");
verifyOriginalSchedule(tableOnOriginalInstallment);
// loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
// loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
// verifyOriginalSchedule(tableOnOriginalInstallment);
applicationDatabaseOperation.updateLSIM(0);
}
Aggregations