use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage 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.CreateLoanAccountsSuccessPage in project head by mifos.
the class LoanTestHelper method createMultipleLoanAccountsWithMixedRestricedPoducts.
public CreateLoanAccountsSuccessPage createMultipleLoanAccountsWithMixedRestricedPoducts(CreateMultipleLoanAccountSelectParameters multipleAccParameters1, CreateMultipleLoanAccountSelectParameters multipleAccParameters2, DisburseLoanParameters disburseParams, String[] clients, String firstRepaymentDate) {
navigationHelper.navigateToAdminPage().navigateToDefineProductMix().createOneMixAndNavigateToClientsAndAccounts(multipleAccParameters1.getLoanProduct(), multipleAccParameters2.getLoanProduct());
CreateLoanAccountsSuccessPage createLoanAccountsSuccessPage = createMultipleLoanAccounts(multipleAccParameters1, clients, "0000-Animal Husbandry");
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.navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseParams).submitAndNavigateToLoanAccountPage();
// additional schedule verification due to MIFOS-4943
loanAccountPage.navigateToRepaymentSchedulePage();
Assert.assertEquals(selenium.getTable("installments.3.1").trim(), firstRepaymentDate);
}
loanAccountPage.navigateToClientsAndAccountsUsingHeaderTab();
return createMultipleLoanAccounts(multipleAccParameters2, clients, "0000-Animal Husbandry");
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountsSuccessPage 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);
}
}
Aggregations