Search in sources :

Example 1 with LoanProductDetailsPage

use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.

the class NavigationHelper method navigateToLoanProductDetailsPage.

public LoanProductDetailsPage navigateToLoanProductDetailsPage(String loanProduct) {
    ViewLoanProductsPage loanProductsPage = navigateToLoanProductsPage();
    LoanProductDetailsPage loanProductDetailsPage = loanProductsPage.viewLoanProductDetails(loanProduct);
    loanProductDetailsPage.verifyPage();
    return loanProductDetailsPage;
}
Also used : ViewLoanProductsPage(org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)

Example 2 with LoanProductDetailsPage

use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.

the class EditLoanProductTest method editExistingLoanProduct.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // one of the dependent methods throws Exception
void editExistingLoanProduct() throws Exception {
    EditLoanProductPage editLoanProductPage = createNewLoanProductAndNavigateToEditLoanPage();
    editLoanProductPage.verifyPage();
    SubmitFormParameters formParameters = new SubmitFormParameters();
    formParameters.setDescription("Modified Description");
    formParameters.setMaxInterestRate("44");
    formParameters.setMinInterestRate("3");
    formParameters.setDefaultInterestRate("18");
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitDescriptionAndInterestChanges(formParameters);
    LoanProductDetailsPage loanProductDetailsPage = editLoanProductPreviewPage.submit();
    loanProductDetailsPage.verifyPage();
    loanProductDetailsPage.editLoanProduct();
    editLoanProductPage.verifyPage();
    editLoanProductPage.verifyModifiedDescriptionAndInterest(formParameters);
}
Also used : EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Example 3 with LoanProductDetailsPage

use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.

the class LoanAccountCycleTest method verifyAmountAndInstallmentsByCycles.

/**
     * Verify loan amount with number of installments by loan cycle can be used to create new loans.
     * http://mifosforge.jira.com/browse/MIFOSTEST-107
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountAndInstallmentsByCycles() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product107");
    productParams.setOfferingShortName("p107");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleLoanAmount = getAmountsByCycle();
    productParams.setCycleLoanAmount(cycleLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] calculateInstallments = getInstallmentsByCycle();
    productParams.setCycleInstallments(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product107");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
    loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(calculateInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "26", "52", "52" });
    loanAccountPage.disburseLoan(disburseParams);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "20", "30", "30" });
}
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)

Example 4 with LoanProductDetailsPage

use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.

the class LoanAccountCycleTest method verifyAmountsAndInstallmentsByLastAmount.

/**
     * Verify loan amount with number of installments by last loan amount can be used to create new loans.
     * http://mifosforge.jira.com/browse/MIFOSTEST-116
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountsAndInstallmentsByLastAmount() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product116");
    productParams.setOfferingShortName("p116");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
    String[][] lastLoanAmount = getAmountsFromLastAmount();
    productParams.setAmountsByLastLoanAmount(lastLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
    String[][] calculateInstallments = getInstallmentsFromLastAmount();
    productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product116");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
    loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "5", "10", "5" });
    String loanFirstID = loanAccountPage.getAccountId();
    loanAccountPage.disburseLoan(disburseParams);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "5", "10", "5" });
    loanTestHelper.repayLoan(loanFirstID);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, new String[] { "10", "20", "15" });
}
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)

Example 5 with LoanProductDetailsPage

use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage 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)

Aggregations

LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)15 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)12 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)11 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)8 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)8 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)8 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)6 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)6 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)4 ViewLoanProductsPage (org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage)4 DateTime (org.joda.time.DateTime)3 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)2 DisburseLoanConfirmationPage (org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage)1 RepayLoanPage (org.mifos.test.acceptance.framework.loan.RepayLoanPage)1 RepayLoanParameters (org.mifos.test.acceptance.framework.loan.RepayLoanParameters)1 DefineNewLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPreviewPage)1 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)1 DefineNewSavingsProductPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductPage)1 EditSavingsProductPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPage)1 EditSavingsProductPreviewPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPreviewPage)1