Search in sources :

Example 6 with AccountChangeStatusPage

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);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) Test(org.testng.annotations.Test)

Aggregations

AccountChangeStatusPage (org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)5 Test (org.testng.annotations.Test)3 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)2 EditAccountStatusConfirmationPage (org.mifos.test.acceptance.framework.loan.EditAccountStatusConfirmationPage)2 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2 ArrayList (java.util.ArrayList)1 LocalDate (org.joda.time.LocalDate)1 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)1 ApplyGroupPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage)1 ApplyGroupPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)1