use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class RedoNewGlimLoanDisbursalTest method checkRedoLoanDisbursal.
@Test(enabled = true)
public void checkRedoLoanDisbursal() throws Exception {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
RedoLoanDisbursalSearchPage redoLoanDisbursalSearchPage = adminPage.navigateToRedoLoanDisbursal();
RedoLoanDisbursalSearchResultsPage redoLoanDisbursalSearchResultsPage = redoLoanDisbursalSearchPage.searchAndNavigateToRedoLoanDisbursalPage("Default Group");
RedoLoanDisbursalChooseLoanInstancePage redoLoanDisbursalChooseLoanInstancePage = redoLoanDisbursalSearchResultsPage.navigateToRedoLoanDisbursalChooseLoanProductPage("Default Group:ID0002-000000011");
RedoLoanDisbursalEntryPage redoLoanDisbursalEntryPage = redoLoanDisbursalChooseLoanInstancePage.submitAndNavigateToRedoLoanDisbursalEntryPage("WeeklyGroupDeclineLoanWithPeriodicFee");
RedoLoanDisbursalParameters redoLoanDisbursalParameters = new RedoLoanDisbursalParameters();
redoLoanDisbursalParameters.addClient(0, "1000", "0001-Cow Purchase");
redoLoanDisbursalParameters.addClient(1, "2000", "0001-Cow Purchase");
redoLoanDisbursalParameters.setInterestRate("10.0");
redoLoanDisbursalParameters.setDisbursalDateDD("23");
//one month earlier
redoLoanDisbursalParameters.setDisbursalDateMM("02");
redoLoanDisbursalParameters.setDisbursalDateYYYY("2011");
RedoLoanDisbursalSchedulePreviewPage redoLoanDisbursalPreviewSchedulePage = redoLoanDisbursalEntryPage.submitWithGLIMandLSIPAndNavigateToPreviewPage(redoLoanDisbursalParameters, true);
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 0, "0", "10/03/2011");
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 0, "0", "10/03/2011");
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 1, "200", "11/03/2011");
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 1, "300", "11/03/2011");
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 2, "100", "12/03/2011");
redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 2, "100", "12/03/2011");
LoanAccountPage loanAccountDetailsPage = redoLoanDisbursalPreviewSchedulePage.submitAndNavigateToRedoLoanDisbursalPreviewPage(true).submitAndNavigateToLoanAccountConfirmationPage().navigateToLoanAccountDetailsPage();
loanAccountDetailsPage.verifyStatus(LoanAccountPage.ACTIVE);
loanAccountDetailsPage.verifyAccountSummary("512", "18/03/2011", "209");
loanAccountDetailsPage.verifyNumberOfInstallments("10");
loanAccountDetailsPage.verifyTotalAmountPaid("700");
loanAccountDetailsPage.verifyTotalOriginalLoan("3,033");
loanAccountDetailsPage.verifyPrincipalBalance("2,315.5");
loanAccountDetailsPage.verifyInterestOriginal("33");
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "297.3", "5.7", "0", "0", "14", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "297.8", "5.2", "0", "0", "8", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(5, "3", "11-Mar-2011", "12-Mar-2011", "89.4", "4.6", "0", "0", "1", "94");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "209", "0", "0", "0", "1", "209");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "299", "4", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "299.5", "3.5", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "300.1", "2.9", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "300.7", "2.3", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "301.2", "1.8", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "301.8", "1.2", "0", "0", "0", "303");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "304.2", "1.8", "0", "0", "0", "306");
loanAccountDetailsPage = viewRepaymentSchedulePage.navigateToLoanAccountPage().navigateToIndividualLoanAccountPage(0);
loanAccountDetailsPage.verifyAccountSummary("104", "18/03/2011", "3");
loanAccountDetailsPage.verifyNumberOfInstallments("10");
loanAccountDetailsPage.verifyTotalAmountPaid("300");
loanAccountDetailsPage.verifyTotalOriginalLoan("1,011");
loanAccountDetailsPage.verifyPrincipalBalance("705.1");
loanAccountDetailsPage.verifyInterestOriginal("11");
viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "99.1", "1.9", "0", "0", "14", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "99.3", "1.7", "0", "0", "8", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(5, "3", "11-Mar-2011", "12-Mar-2011", "96.5", "1.5", "0", "0", "1", "98");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "3", "0", "0", "0", "1", "3");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "99.7", "1.3", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "99.8", "1.2", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "100", "1", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "100.2", "0.8", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "100.4", "0.6", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "100.6", "0.4", "0", "0", "0", "101");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "101.4", "0.6", "0", "0", "0", "102");
loanAccountDetailsPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
loanAccountDetailsPage = loanAccountDetailsPage.navigateToGroupLoanPageFromIndividualLoanPage();
loanAccountDetailsPage = loanAccountDetailsPage.navigateToIndividualLoanAccountPage(1);
loanAccountDetailsPage.verifyAccountSummary("408", "18/03/2011", "206");
loanAccountDetailsPage.verifyNumberOfInstallments("10");
loanAccountDetailsPage.verifyTotalAmountPaid("400");
loanAccountDetailsPage.verifyTotalOriginalLoan("2,022");
loanAccountDetailsPage.verifyPrincipalBalance("1,607.3");
loanAccountDetailsPage.verifyInterestOriginal("22");
viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "198.2", "3.8", "0", "0", "14", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "194.5", "3.5", "0", "0", "8", "198");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(6, "2", "04-Mar-2011", "-", "4", "0", "0", "0", "8", "4");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "198.9", "3.1", "0", "0", "4", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "199.3", "2.7", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "199.7", "2.3", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "200.1", "1.9", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "200.5", "1.5", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "200.8", "1.2", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "201.2", "0.8", "0", "0", "0", "202");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "202.8", "1.2", "0", "0", "0", "204");
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class PenaltyHelper method verifyCalculatePenaltyWithoutPayment.
public void verifyCalculatePenaltyWithoutPayment(final String accountId, final String[] summaryPenalty, final String[][] schedulePenalty, final String[] accountSummary) {
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(accountId);
verifyCalculatePenaltyOnLoanAccountScreen(loanAccountPage, summaryPenalty, accountSummary);
ViewRepaymentSchedulePage repaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
for (int i = 0; i < schedulePenalty.length; ++i) {
if (schedulePenalty[i] != null) {
repaymentSchedulePage.verifyInstallmentAmount(4 + i, 7, schedulePenalty[i][0]);
repaymentSchedulePage.verifyInstallmentAmount(4 + i, 9, schedulePenalty[i][1]);
}
}
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class PenaltyHelper method verifyCalculatePenaltyWithPayment.
public void verifyCalculatePenaltyWithPayment(final String accountId, final String[] summaryPenalty, final String[][] schedulePenalty, final String[] accountSummary) {
ViewRepaymentSchedulePage repaymentSchedulePage = navigationHelper.navigateToLoanAccountPage(accountId).navigateToRepaymentSchedulePage();
for (int i = 0; i < schedulePenalty.length; ++i) {
if (schedulePenalty[i] != null) {
repaymentSchedulePage.verifyRepaymentScheduleTableRow(3 + i, 6, schedulePenalty[i][0]);
repaymentSchedulePage.verifyRepaymentScheduleTableRow(3 + i, 8, schedulePenalty[i][1]);
}
}
verifyCalculatePenaltyOnLoanAccountScreen(repaymentSchedulePage.navigateToLoanAccountPage(), summaryPenalty, accountSummary);
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class ViewOriginalLoanScheduleTest method verifyForVariableInstallmentLoanEarlyDisbursal.
// http://mifosforge.jira.com/browse/MIFOSTEST-1163
//blocked by http://mifosforge.jira.com/browse/MIFOS-5026 - ldomzalski
@Test(enabled = false)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyForVariableInstallmentLoanEarlyDisbursal() throws Exception {
//Given
int interestType = DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE;
DateTime disbursalDate = systemDateTime.plusDays(1);
applicationDatabaseOperation.updateLSIM(1);
DefineNewLoanProductPage.SubmitFormParameters formParameters = defineLoanProductParameters(interestType);
CreateLoanAccountSubmitParameters accountSubmitParameters = new CreateLoanAccountSubmitParameters();
accountSubmitParameters.setAmount("1000.0");
accountSubmitParameters.setInterestRate("20");
accountSubmitParameters.setNumberOfInstallments("5");
accountSubmitParameters.setDd("11");
accountSubmitParameters.setMm("10");
accountSubmitParameters.setYy("2011");
String[] fees = { "fixedFeePerAmountAndInterest", "fixedFeePerInterest" };
EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
editAccountParameters.setGracePeriod("0");
formParameters.addFee("fixedFeePerAmountAndInterest");
formParameters.addFee("fixedFeePerInterest");
//When
DefineNewLoanProductPage defineNewLoanProductPage = loanProductTestHelper.navigateToDefineNewLoanPageAndFillMandatoryFields(formParameters).fillVariableInstalmentOption("30", "1", "100");
defineNewLoanProductPage.submitWithErrors("fee cannot be applied to variable installment loan product");
defineNewLoanProductPage.setInterestRateType(DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION);
defineNewLoanProductPage.submitWithErrors("The selected interest type is invalid for variable installment loan product");
defineNewLoanProductPage.setInterestRateType(interestType);
defineNewLoanProductPage.submitAndGotoNewLoanProductPreviewPage().submit();
List<String> errors = new ArrayList<String>();
errors.add("fixedFeePerAmountAndInterest fee cannot be applied to loan with variable installments");
errors.add("fixedFeePerInterest fee cannot be applied to loan with variable installments.");
navigationHelper.navigateToHomePage();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(disbursalDate).applyAdditionalFees(fees).submitWithErrors(errors).unselectAdditionalFees().clickContinue();
createLoanAccountReviewInstallmentPage.isDueDatesEditable(Integer.parseInt(formParameters.getDefInstallments()));
createLoanAccountReviewInstallmentPage.isTotalsEditable(Integer.parseInt(formParameters.getDefInstallments()));
String total = createLoanAccountReviewInstallmentPage.getTotalForInstallment(1);
createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, "3");
createLoanAccountReviewInstallmentPage.submitWithErrors("has total amount less than the sum of interest and fees");
createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, "5");
createLoanAccountReviewInstallmentPage.submitWithErrors("has total amount less than the allowed value");
createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, total);
createLoanAccountReviewInstallmentPage.validate();
Calendar calendar = Calendar.getInstance();
calendar.set(2011, 9, 13);
String prevDueDate = createLoanAccountReviewInstallmentPage.getDueDateForInstallment(1);
createLoanAccountReviewInstallmentPage.typeInstallmentDueDateByPicker(1, calendar);
createLoanAccountReviewInstallmentPage.setDueDateForInstallment(1, prevDueDate);
prevDueDate = createLoanAccountReviewInstallmentPage.getDueDateForInstallment(5);
createLoanAccountReviewInstallmentPage.setDueDateForInstallment(5, "07/11/11");
createLoanAccountReviewInstallmentPage.submitWithErrors("Gap between the due dates of installment 5 and the previous installment is less than allowed");
createLoanAccountReviewInstallmentPage.setDueDateForInstallment(5, prevDueDate);
List<String> totals = createLoanAccountReviewInstallmentPage.getTotalsInstallments(Integer.parseInt(formParameters.getDefInstallments()));
List<String> dueDates = createLoanAccountReviewInstallmentPage.getDueDatesInstallments(Integer.parseInt(formParameters.getDefInstallments()));
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
createLoanAccountPreviewPage.verifyInstallmentsSchedule(totals, dueDates, Integer.parseInt(formParameters.getDefInstallments()));
LoanAccountPage loanAccountPage = createLoanAccountPreviewPage.submit().navigateToLoanAccountDetailsPage();
loanAccountPage.verifyDisbursalDate(disbursalDate);
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyScheduleAndAmounts(totals, dueDates);
viewRepaymentSchedulePage.navigateBack();
EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
editLoanAccountInformationPage.verifyAccountParams(accountSubmitParameters, editAccountParameters);
editLoanAccountInformationPage.navigateBack();
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
loanTestHelper.approveLoan();
loanTestHelper.disburseLoan(systemDateTime);
String[][] tableOnOriginalInstallment = OriginalScheduleData.VARIABLE_LOAN_EARLY_DISBURSAL_SCHEDULE;
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.makePayment(systemDateTime.plusDays(5), "100");
//Then
verifyOriginalSchedule(tableOnOriginalInstallment);
applicationDatabaseOperation.updateLSIM(0);
}
use of org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage in project head by mifos.
the class CreateLSIMClientLoanAccountTest method createLoanAccountWithNonMeetingDatesForDisburseAndRepay.
// http://mifosforge.jira.com/browse/MIFOSTEST-123
@Test(enabled = true)
public void createLoanAccountWithNonMeetingDatesForDisburseAndRepay() throws Exception {
//Given
setTime(2011, 03, 24);
String errorMessage = "";
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setLoanProduct("ClientEmergencyLoan");
formParameters.setSearchString("UpdateCustomProperties TestClient");
for (int i = 0; i < 2; i++) {
CreateLoanAccountSearchPage createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("1");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
errorMessage = "No text <Stu12332659912419 Client12332659912419:ID0002-000000030> present on the page";
createLoanAccountSearchPage.verifyTextPresent("Stu12332659912419 Client12332659912419:ID0002-000000030", errorMessage);
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString(" ");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
errorMessage = "No text <Stu1233266063395 Client1233266063395:ID0002-000000003> present on the page";
createLoanAccountSearchPage.verifyTextPresent("Stu1233266063395 Client1233266063395:ID0002-000000003", errorMessage);
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("%");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
createLoanAccountSearchPage.waitForElementToPresent("name=customerSearchResults_length");
verify10SearchResults();
verify25SearchResults();
verify50SearchResults();
verify100SearchResults();
formParameters.setSearchString("UpdateCustomProperties TestClient");
navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu().verifyNoSelectLoanProduct(formParameters, "Please select a Loan product name");
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("UpdateCustomProperties TestClient");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu().searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.verifyAllowedAmounts("1,000", "10,000", "1000.0");
createLoanAccountEntryPage.verifyDisbsursalDate("25", "3", "2011");
createLoanAccountEntryPage.setAmount("");
createLoanAccountEntryPage.setInstallments("");
createLoanAccountEntryPage.setDisbursalDate("", "", "");
createLoanAccountEntryPage.setInterestRate("");
createLoanAccountEntryPage.setLonaPurpose("0008-Animal Trading");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("Please specify valid Amount. Amount should be a value between 1,000 and 10,000, inclusive.");
createLoanAccountEntryPage.verifyError("Please specify valid Interest rate. Interest rate should be a value between 0 and 0, inclusive.");
createLoanAccountEntryPage.verifyError("Please specify valid No. of installments. No. of installments should be a value between 1 and 10, inclusive.");
createLoanAccountEntryPage.verifyError("You have entered an invalid disbursal date. Please check the date format.");
createLoanAccountEntryPage.setDisbursalDate("26", "02", "2011");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The disbursement date is invalid. Disbursement date must be on or after todays date.");
createLoanAccountEntryPage.setDisbursalDate("21", "01", "2012");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
if (i % 2 == 0) {
createLoanAccountEntryPage.verifyNoError("The disbursement date is invalid. It must fall on a valid customer meeting schedule.");
} else {
createLoanAccountEntryPage.verifyError("The disbursement date is invalid. It must fall on a valid customer meeting schedule.");
}
createLoanAccountEntryPage.setDisbursalDate("25", "3", "2011");
createLoanAccountEntryPage.setAmount("999999999999999999.88888888");
createLoanAccountEntryPage.setInterestRate("999999999999.88888888");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The interest rate is invalid as the number of digits after the decimal separator exceeds the allowed number of 5.");
createLoanAccountEntryPage.verifyError("The amount is invalid because the number of digits before the decimal separator exceeds the allowed number of 14.");
createLoanAccountEntryPage.setAmount("12345678901234");
createLoanAccountEntryPage.setInterestRate("999999999999.88888888");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The interest rate is invalid as the number of digits after the decimal separator exceeds the allowed number of 5.");
CreateLoanAccountSubmitParameters formParametersFees = new CreateLoanAccountSubmitParameters();
formParametersFees.setAdditionalFee1("loanWeeklyFee");
formParametersFees.setAdditionalFee2("oneTimeFee");
createLoanAccountEntryPage.setAmount("5000");
createLoanAccountEntryPage.setInterestRate("0.0");
createLoanAccountEntryPage.setInstallments("10");
createLoanAccountEntryPage.fillAdditionalFee(formParametersFees);
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.clickContinue();
createLoanAccountReviewInstallmentPage.verifyLoanAmount("5,000");
createLoanAccountReviewInstallmentPage.verifyDueDate(1, "01/04/11");
createLoanAccountReviewInstallmentPage.verifyDueDate(2, "08/04/11");
createLoanAccountReviewInstallmentPage.verifyDueDate(10, "03/06/11");
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndNavigateToPreviewPage();
createLoanAccountPreviewPage.verifyLoanAmount("5,000");
createLoanAccountPreviewPage.verifyInterestTypeInLoanPreview("Flat");
createLoanAccountPreviewPage.verifyDueDate(1, "01-Apr-2011");
createLoanAccountPreviewPage.verifyDueDate(2, "08-Apr-2011");
createLoanAccountPreviewPage.verifyDueDate(10, "03-Jun-2011");
createLoanAccountEntryPage = createLoanAccountPreviewPage.editAccountInformation();
createLoanAccountEntryPage.setAmount("2000.0");
createLoanAccountPreviewPage = createLoanAccountEntryPage.clickContinue().clickPreviewAndNavigateToPreviewPage();
createLoanAccountPreviewPage.verifyLoanAmount("2,000");
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
errorMessage = "No text <View loan account details now> present on the page";
createLoanAccountConfirmationPage.verifyTextPresent("View loan account details now", errorMessage);
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
loanAccountPage.verifyStatus("Application Pending Approval");
loanAccountPage.verifyDisbursalDate("25/03/2011");
String[][] accountSummaryTable = { { "", "Original Loan", "Amount paid", "Loan balance" }, { "Principal", "2,000", "0", "2,000" }, { "Interest", "0", "0", "0" }, { "Fees", "1,010", "0", "1,010" }, { "Penalty", "0", "0", "0" }, { "Total", "3,010", "0", "3,010" } };
loanAccountPage.verifyAccountSummary(accountSummaryTable);
loanAccountPage.verifyInterestRate("0");
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "01-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "08-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "22-Apr-2011");
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
editLoanAccountInformationPage.setAmount("3000.0");
loanAccountPage = editLoanAccountInformationPage.submitAndNavigateToAccountInformationPreviewPage().submitAndNavigateToLoanAccountPage();
loanAccountPage.verifyLoanAmount("3000.0");
applicationDatabaseOperation.updateLSIM(0);
}
}
Aggregations