Search in sources :

Example 91 with LoanAccountPage

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

Example 92 with LoanAccountPage

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

Example 93 with LoanAccountPage

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();
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 94 with LoanAccountPage

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

Example 95 with LoanAccountPage

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

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