use of org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage 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);
}
Aggregations