Search in sources :

Example 1 with DisburseLoanConfirmationPage

use of org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage in project head by mifos.

the class CreateClientLoanAccountTest method verifyCreatingLoanAccountsOnProductWithLoanCycles.

/**
     * Verify the loan product created with default number of installments
     * by loan cycle can be used to create new loans accounts.
     * http://mifosforge.jira.com/browse/MIFOSTEST-99
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCreatingLoanAccountsOnProductWithLoanCycles() throws Exception {
    setAppDate(new DateTime(2011, 1, 24, 15, 0, 0, 0));
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("ProdTest99");
    productParams.setOfferingShortName("T99");
    productParams.setMinLoanAmount("1000");
    productParams.setMaxLoanAmount("10000");
    productParams.setDefaultLoanAmount("5000");
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleInstallments = { { "26", "52", "52" }, { "20", "30", "30" }, { "15", "25", "25" }, { "10", "15", "15" }, { "5", "10", "10" }, { "1", "5", "5" } };
    productParams.setCycleInstallments(cycleInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu12332659912419 Client12332659912419");
    searchParams.setLoanProduct("ProdTest99");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    disburseParams.setDisbursalDateDD("24");
    disburseParams.setDisbursalDateMM("01");
    disburseParams.setDisbursalDateYYYY("2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyLoanAmountTableTypeSame("1,000", "10,000", "5,000");
    loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(cycleInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
    loanAccountPage.verifyNumberOfInstallments("26", "52", "52");
    String loan1ID = loanAccountPage.getAccountId();
    loanTestHelper.repayLoan(loan1ID);
    loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
    //extension MIFOSTEST-1186
    loanAccountPage.navigateToViewLoanAccountActivityPage();
    loanAccountPage.verifyPage("ViewLoanAccountActivity");
    Assert.assertEquals(selenium.getTable("accountActivityTable.2.1"), "Loan Disbursal");
    Assert.assertEquals(selenium.getTable("accountActivityTable.2.2"), "5,000");
    Assert.assertEquals(selenium.getTable("accountActivityTable.2.11"), "5,288");
    loanAccountPage.navigateBack();
    loanAccountPage.verifyNumberOfInstallments("20", "30", "30");
    String loan2ID = loanAccountPage.getAccountId();
    loanTestHelper.repayLoan(loan2ID);
    loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
    loanAccountPage.verifyNumberOfInstallments("15", "25", "25");
    // extension to verify MIFOS-5005
    DisburseLoanConfirmationPage disburseLoanConfirmationPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams).navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseParams);
    disburseLoanConfirmationPage.submitButDisbursalFailed("This loan cannot be disbursed because the customer already has an active loan for this loan product.");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime) DisburseLoanConfirmationPage(org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage)

Example 2 with DisburseLoanConfirmationPage

use of org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage in project head by mifos.

the class LoanTestHelper method disburseLoan.

/**
     * Disburses the loan with id <tt>loanId</tt>.
     * @param loanId The system/global id of the loan that'll be disbursed.
     * @param disburseParameters The disbursal parameters.
     * @return The loan account page of the loan account with id loanId.
     */
public LoanAccountPage disburseLoan(String loanId, DisburseLoanParameters disburseParameters) {
    DisburseLoanPage disburseLoanPage = prepareToDisburseLoan(loanId);
    DisburseLoanConfirmationPage disburseLoanConfirmationPage = disburseLoanPage.submitAndNavigateToDisburseLoanConfirmationPage(disburseParameters);
    LoanAccountPage loanAccountPage = disburseLoanConfirmationPage.submitAndNavigateToLoanAccountPage();
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    return loanAccountPage;
}
Also used : DisburseLoanPage(org.mifos.test.acceptance.framework.loan.DisburseLoanPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) DisburseLoanConfirmationPage(org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage)

Aggregations

DisburseLoanConfirmationPage (org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage)2 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)2 DateTime (org.joda.time.DateTime)1 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)1 DisburseLoanPage (org.mifos.test.acceptance.framework.loan.DisburseLoanPage)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)1 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)1