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");
}
}
}
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();
}
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");
}
}
Aggregations