Search in sources :

Example 76 with LoanAccountPage

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);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 77 with LoanAccountPage

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);
}
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) ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage) Test(org.testng.annotations.Test)

Example 78 with LoanAccountPage

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);
}
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)

Example 79 with LoanAccountPage

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();
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 80 with LoanAccountPage

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();
}
Also used : SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Aggregations

LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)130 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)50 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)37 Test (org.testng.annotations.Test)36 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)29 DateTime (org.joda.time.DateTime)28 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)20 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)16 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)15 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)14 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)10 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)10 ArrayList (java.util.ArrayList)9 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)9 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)9 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)9 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)8 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8