Search in sources :

Example 66 with CreateLoanAccountSearchParameters

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

the class ViewOriginalLoanScheduleTest method setLoanSearchParameters.

private CreateLoanAccountSearchParameters setLoanSearchParameters() {
    CreateLoanAccountSearchParameters accountSearchParameters = new CreateLoanAccountSearchParameters();
    accountSearchParameters.setLoanProduct(loanProductName);
    accountSearchParameters.setSearchString(clientName);
    return accountSearchParameters;
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)

Example 67 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method verifyCancelButtons.

/**
    * Verify functionality of 'Cancel' buttons during the Loan creation flow
    * http://mifosforge.jira.com/browse/MIFOSTEST-1178
    *
    * @throws Exception
    */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCancelButtons() throws Exception {
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    createLoanAccountSearchPage.cancel();
    clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("%");
    createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
    createLoanAccountSearchPage.cancel();
    clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters2 = new CreateLoanAccountSearchParameters();
    formParameters2.setSearchString("Client1233266063395");
    CreateLoanAccountSelectLoanProductPage createLoanAccountSelectLoanProductPage = createLoanAccountSearchPage.navigateToCreateLoanAccountSelectLoanProductPage(formParameters2);
    createLoanAccountSelectLoanProductPage.cancel();
    clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    formParameters2.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters2);
    createLoanAccountEntryPage.cancel();
    clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters2);
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    createLoanAccountReviewInstallmentPage.cancel();
    clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters2);
    createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    createLoanAccountPreviewPage.cancel();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) ClientsAndAccountsHomepage(org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage) CreateLoanAccountSelectLoanProductPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSelectLoanProductPage) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 68 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method createLoanAccountsWithRestrictedProductsMix.

/**
     * Verify a user is prevented to create loan accounts of loan products restricted by the mix.
     * http://mifosforge.jira.com/browse/MIFOSTEST-94
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createLoanAccountsWithRestrictedProductsMix() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 1, 24, 15, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product94");
    productParams.setOfferingShortName("p94");
    productParams.setDefaultInterestRate("15.3");
    productParams.setMaxInterestRate("50");
    productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE);
    productParams.setDefaultLoanAmount("13333");
    productParams.setDefInstallments("13");
    productParams.setApplicableFor(DefineNewLoanProductPage.SubmitFormParameters.GROUPS);
    loanProductTestHelper.defineNewLoanProduct(productParams);
    productParams.setOfferingName("product94B");
    productParams.setOfferingShortName("p94b");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    CreateLoanAccountSearchParameters searchParams1 = new CreateLoanAccountSearchParameters();
    searchParams1.setSearchString("GroupWeekly");
    searchParams1.setLoanProduct("product94");
    CreateLoanAccountSearchParameters searchParams2 = new CreateLoanAccountSearchParameters();
    searchParams2.setSearchString("GroupWeekly");
    searchParams2.setLoanProduct("product94B");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    disburseParams.setDisbursalDateDD("24");
    disburseParams.setDisbursalDateMM("01");
    disburseParams.setDisbursalDateYYYY("2011");
    String error = "The loan could not be disbursed as " + searchParams1.getLoanProduct() + " and " + searchParams2.getLoanProduct() + " are not allowed to co-exist";
    LoanAccountPage loanAccountPage = loanTestHelper.createTwoLoanAccountsWithMixedRestricedPoducts(searchParams1, searchParams2, disburseParams, new DateTime(2011, 02, 28, 10, 0, 0, 0));
    loanAccountPage.verifyError(error);
}
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) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 69 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method verifyAccountFromProductInstallmentsSame.

/**
     * Verify loan product created with default loan amount and number of installments
     * are "same for all loans" can be used to create new loan accounts with the correct default amounts.
     * http://mifosforge.jira.com/browse/MIFOSTEST-97
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public //CreateClient: weekly, Stu12332659912419 Client12332659912419, monday, activate
void verifyAccountFromProductInstallmentsSame() throws Exception {
    setAppDate(new DateTime(2011, 1, 24, 15, 0, 0, 0));
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("ProdTest97");
    productParams.setOfferingShortName("T97");
    productParams.setMinLoanAmount("1000");
    productParams.setMaxLoanAmount("10000");
    productParams.setDefaultLoanAmount("5000");
    productParams.setMinInstallemnts("10");
    productParams.setMaxInstallments("100");
    productParams.setDefInstallments("50");
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu12332659912419 Client12332659912419");
    searchParams.setLoanProduct("ProdTest97");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    disburseParams.setDisbursalDateDD("24");
    disburseParams.setDisbursalDateMM("01");
    disburseParams.setDisbursalDateYYYY("2011");
    ChargeParameters chargeParameters = new ChargeParameters();
    chargeParameters.setType(ChargeParameters.MISC_FEES);
    chargeParameters.setAmount("599.0");
    LoanAccountPage loanAccountPage = loanTestHelper.createProductAndThenAccount(productParams, searchParams, disburseParams);
    loanAccountPage.verifyNumberOfInstallments("10", "100", "50");
    loanAccountPage.verifyPrincipalBalance("5,000");
    loanTestHelper.applyOneChargeOnLoanAccount(chargeParameters);
    loanAccountPage.navigateToViewInstallmentDetails().verifyInstallmentAmount(4, 1, "599");
}
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) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 70 with CreateLoanAccountSearchParameters

use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters 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

CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)95 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)50 Test (org.testng.annotations.Test)46 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)36 DateTime (org.joda.time.DateTime)35 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)26 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)22 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)19 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)19 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)13 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)12 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)12 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)11 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)11 ArrayList (java.util.ArrayList)9 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)8 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)7