Search in sources :

Example 1 with CreateLoanAccountsEntryPage

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

the class LoanTestHelper method createMultipleLoanAccountsAndVerify.

public void createMultipleLoanAccountsAndVerify(CreateMultipleLoanAccountSelectParameters multipleAccParameters, String[] clients, String loanPurpose, Boolean saveMethod) {
    String[] clientsInstallments = loanProductTestHelper.getDefaultNoOfInstallmentsForClients(clients, multipleAccParameters.getLoanProduct());
    CreateLoanAccountsEntryPage createLoanAccountsEntryPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateMultipleLoanAccountsUsingLeftMenu().searchAndNavigateToCreateMultipleLoanAccountsEntryPage(multipleAccParameters);
    for (int i = 0; i < clients.length; i++) {
        createLoanAccountsEntryPage.selectClients(i, clients[i]);
        createLoanAccountsEntryPage.updateLoanPurposeForClient(i, loanPurpose);
        createLoanAccountsEntryPage.verifyNoOfInstallments(i + 1, "10");
    }
    LoanAccountPage loanAccountPage;
    CreateLoanAccountsSuccessPage createLoanAccountsSuccessPage;
    if (saveMethod) {
        createLoanAccountsSuccessPage = createLoanAccountsEntryPage.submitAndNavigateToCreateMultipleLoanAccountsSuccessPage();
    } else {
        createLoanAccountsSuccessPage = createLoanAccountsEntryPage.saveAndNavigateToCreateMultipleLoanAccountsSuccessPage();
    }
    List<String> accountNumbers = createLoanAccountsSuccessPage.verifyAndGetLoanAccountNumbers(clients.length);
    for (int i = 0; i < accountNumbers.size(); i++) {
        if (i > 0) {
            loanAccountPage = navigationHelper.navigateToClientsAndAccountsPage().searchForClient(accountNumbers.get(i)).navigateToLoanAccountSearchResult("Account # " + accountNumbers.get(i));
            if (saveMethod) {
                loanAccountPage.verifyLoanStatus(AccountStatus.LOAN_PENDING_APPROVAL.getStatusText());
            } else {
                loanAccountPage.verifyLoanStatus(AccountStatus.LOAN_PARTIAL.getStatusText());
            }
            loanAccountPage.verifyNumberOfInstallments("10");
        }
    }
}
Also used : CreateLoanAccountsSuccessPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage) CreateLoanAccountsEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsEntryPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 2 with CreateLoanAccountsEntryPage

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

the class LoanTestHelper method createMultipleLoanAccounts.

/**
     * Creates multiple accounts and navigates to creation success page.
     * Must be on Clients And Accounts page.
     * @param multipleAccParameters
     * @param clients
     * @param loanPurpose
     * @return
     */
public CreateLoanAccountsSuccessPage createMultipleLoanAccounts(CreateMultipleLoanAccountSelectParameters multipleAccParameters, String[] clients, String loanPurpose) {
    CreateLoanAccountsEntryPage createLoanAccountsEntryPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateMultipleLoanAccountsUsingLeftMenu().searchAndNavigateToCreateMultipleLoanAccountsEntryPage(multipleAccParameters);
    for (int i = 0; i < clients.length; i++) {
        createLoanAccountsEntryPage.selectClients(i, clients[i]);
        createLoanAccountsEntryPage.updateLoanPurposeForClient(i, loanPurpose);
    }
    return createLoanAccountsEntryPage.submitAndNavigateToCreateMultipleLoanAccountsSuccessPage();
}
Also used : CreateLoanAccountsEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountsEntryPage)

Example 3 with CreateLoanAccountsEntryPage

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

Aggregations

CreateLoanAccountsEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountsEntryPage)3 CreateLoanAccountsSuccessPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage)1 CreateMultipleLoanAccountSelectParameters (org.mifos.test.acceptance.framework.loan.CreateMultipleLoanAccountSelectParameters)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)1 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)1