Search in sources :

Example 1 with CreateMultipleLoanAccountSelectParameters

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

the class CreateMultipleLoanAccountTest method verifyCreatingWithProductInstallmentsByLoanCycle.

/**
     * Verify multiple loan accounts can be created for
     * clients with loans having installments by loan cycle.
     * http://mifosforge.jira.com/browse/MIFOSTEST-117
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCreatingWithProductInstallmentsByLoanCycle() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("LoanCycleProduct");
    productParams.setOfferingShortName("p117");
    productParams.setCalculateLoanAmount(SubmitFormParameters.SAME_FOR_ALL_LOANS);
    productParams.setMinLoanAmount("5000");
    productParams.setMaxLoanAmount("10000");
    productParams.setDefaultLoanAmount("7500");
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] calculateInstallments = new String[][] { { "26", "52", "52" }, { "20", "30", "30" }, { "15", "25", "25" }, { "10", "15", "15" }, { "5", "10", "10" }, { "1", "5", "5" } };
    productParams.setCycleInstallments(calculateInstallments);
    CreateMultipleLoanAccountSelectParameters multipleSelectParams = new CreateMultipleLoanAccountSelectParameters();
    multipleSelectParams.setBranch("MyOfficeDHMFT");
    multipleSelectParams.setLoanOfficer("loan officer");
    multipleSelectParams.setCenter("Default Center");
    multipleSelectParams.setLoanProduct("LoanCycleProduct");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    CreateLoanAccountsEntryPage createLoanAccountsEntryPage = navigateToCreateMultipleLoanAccountsEntryPage(multipleSelectParams);
    for (int i = 0; i < 4; i++) {
        createLoanAccountsEntryPage.verifyNoOfInstallments(i, "52");
    }
}
Also used : SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters) CreateLoanAccountsEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsEntryPage)

Example 2 with CreateMultipleLoanAccountSelectParameters

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

the class CreateMultipleLoanAccountsWithFeesTest method createBulkLoanAccountsInPartialApplicationStatus.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-55
void createBulkLoanAccountsInPartialApplicationStatus() throws Exception {
    //Given
    CreateMultipleLoanAccountSelectParameters multipleAccParameters = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    multipleAccParameters.setBranch("MyOfficeDHMFT");
    multipleAccParameters.setCenter("Default Center");
    multipleAccParameters.setLoanOfficer("loan officer");
    String[] clients = new String[2];
    clients[0] = "client1 lastname";
    clients[1] = "ClientWithLoan 20110221";
    //Then
    loanTestHelper.createMultipleLoanAccountsAndVerify(multipleAccParameters, clients, "0000-Animal Husbandry", LoanTestHelper.METHOD_SAVE_FOR_LATER);
}
Also used : CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters)

Example 3 with CreateMultipleLoanAccountSelectParameters

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

the class CreateClientLoanAccountTest method createMultipleLoanAccountsWithRestrictedProductsMix.

/**
     * Verify a user is prevented from creating a second loan account
     * (for two or more clients using the bulk loan creation pipeline)
     * with a loan product restricted with the first loan.
     * http://mifosforge.jira.com/browse/MIFOSTEST-95
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createMultipleLoanAccountsWithRestrictedProductsMix() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 3, 18, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product95");
    productParams.setOfferingShortName("p95");
    productParams.setDefaultInterestRate("15.3");
    productParams.setMaxInterestRate("50");
    productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE);
    productParams.setDefaultLoanAmount("13333");
    productParams.setDefInstallments("13");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    productParams.setOfferingName("product95B");
    productParams.setOfferingShortName("p95b");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    CreateMultipleLoanAccountSelectParameters multipleAccParameters1 = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters1.setBranch("MyOfficeDHMFT");
    multipleAccParameters1.setLoanOfficer("loan officer");
    multipleAccParameters1.setCenter("WeeklyMeetingCenter");
    multipleAccParameters1.setLoanProduct("product95");
    CreateMultipleLoanAccountSelectParameters multipleAccParameters2 = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters2.setBranch("MyOfficeDHMFT");
    multipleAccParameters2.setLoanOfficer("loan officer");
    multipleAccParameters2.setCenter("WeeklyMeetingCenter");
    multipleAccParameters2.setLoanProduct("product95B");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    disburseParams.setDisbursalDateDD("18");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    String error = "The loan could not be disbursed as " + multipleAccParameters1.getLoanProduct() + " and " + multipleAccParameters2.getLoanProduct() + " are not allowed to co-exist";
    String[] clients = new String[1];
    clients[0] = "MemberWeekly Group";
    String firstRepaymentDate = "21-Mar-2011";
    CreateLoanAccountsSuccessPage createLoanAccountsSuccessPage = loanTestHelper.createMultipleLoanAccountsWithMixedRestricedPoducts(multipleAccParameters1, multipleAccParameters2, disburseParams, clients, firstRepaymentDate);
    List<String> accountNumbers = createLoanAccountsSuccessPage.verifyAndGetLoanAccountNumbers(clients.length);
    LoanAccountPage loanAccountPage = createLoanAccountsSuccessPage.selectLoansAndNavigateToLoanAccountPage(0);
    for (int i = 0; i < accountNumbers.size(); i++) {
        if (i > 0) {
            loanAccountPage = loanAccountPage.navigateToClientsAndAccountsUsingHeaderTab().searchForClient(accountNumbers.get(i)).navigateToLoanAccountSearchResult("Account # " + accountNumbers.get(i));
        }
        loanAccountPage.changeAccountStatusToAccepted();
        loanAccountPage.tryNavigatingToDisburseLoanWithError();
        loanAccountPage.verifyError(error);
    }
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountsSuccessPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters) 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 4 with CreateMultipleLoanAccountSelectParameters

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

the class CreateMultipleLoanAccountsWithFeesTest method createBulkLoanAccountsInPendingApprovalStatus.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-54
void createBulkLoanAccountsInPendingApprovalStatus() throws Exception {
    //Given
    CreateMultipleLoanAccountSelectParameters multipleAccParameters = new CreateMultipleLoanAccountSelectParameters();
    multipleAccParameters.setBranch("MyOfficeDHMFT");
    multipleAccParameters.setLoanOfficer("loan officer");
    multipleAccParameters.setCenter("Default Center");
    String loanProduct = "WeeklyFlatLoanWithOneTimeFees";
    multipleAccParameters.setLoanProduct(loanProduct);
    String[] clients = new String[2];
    clients[0] = "client1 lastname";
    clients[1] = "ClientWithLoan 20110221";
    String[] clientsDeselected = new String[1];
    clientsDeselected[0] = "Stu1233266319760 Client1233266319760";
    //Then
    loanTestHelper.createMultipleLoanAccountsAndVerify(multipleAccParameters, clients, "0000-Animal Husbandry", loanTestHelper.METHOD_SUBMIT_FOR_APPROVAL);
    loanTestHelper.verifyLoansAreNotOnClientsLoanLists(clientsDeselected, loanProduct);
}
Also used : CreateMultipleLoanAccountSelectParameters(org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters)

Aggregations

CreateMultipleLoanAccountSelectParameters (org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters)4 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)2 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)2 DateTime (org.joda.time.DateTime)1 CreateLoanAccountsEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountsEntryPage)1 CreateLoanAccountsSuccessPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)1 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)1 Test (org.testng.annotations.Test)1