use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class UpdateCustomPropertiesTest method verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts.
/*
* FIXME - keithw - test passes when run individually but not as part of ci build. it appears that question groups data is not
* cleaned up right as instead of stepping to review installments, the questionnaire page is presented.
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//http://mifosforge.jira.com/browse/MIFOSTEST-215
@Test(enabled = true)
public void verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts() throws Exception {
//Given
propertiesHelper.setSavingsPendingApprovalStateEnabled("true");
propertiesHelper.setLoanPendingApprovalStateEnabled("true");
propertiesHelper.setGroupPendingApprovalStateEnabled("true");
//When
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString("UpdateCustomProperties TestClient");
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("248.0");
SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
savingsAccountPage.verifyPage();
//Then
savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
savingsAccountPage.verifyStatus("Application Pending Approval");
//when
CreateLoanAccountSearchParameters searchParameters2 = new CreateLoanAccountSearchParameters();
searchParameters2.setSearchString("UpdateCustomProperties TestClient");
searchParameters2.setLoanProduct("ClientEmergencyLoan");
CreateLoanAccountSubmitParameters submitAccountParameters2 = new CreateLoanAccountSubmitParameters();
submitAccountParameters2.setAmount("2765.0");
submitAccountParameters2.setGracePeriodTypeNone(true);
LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters2, submitAccountParameters2);
loanAccountPage.verifyStatus("Application Pending Approval");
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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.LoanAccountPage in project head by mifos.
the class LoanTestHelper method verifyTransactionHistory.
public void verifyTransactionHistory(String loanId, Double paymentAmount) {
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistory();
transactionHistoryPage.verifyTransactionHistory(paymentAmount, 1, 6);
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class LoanTestHelper method repayLoan.
/**
* Repay loan account with id <tt>loanId</tt>.
* @param loanId The account id.
* @return The loan account page for the loan account.
*/
public LoanAccountPage repayLoan(String loanId) {
RepayLoanParameters params = new RepayLoanParameters();
params.setModeOfRepayment(RepayLoanParameters.CASH);
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
RepayLoanPage repayLoanPage = loanAccountPage.navigateToRepayLoan();
RepayLoanConfirmationPage repayLoanConfirmationPage = repayLoanPage.submitAndNavigateToRepayLoanConfirmationPage(params);
loanAccountPage = repayLoanConfirmationPage.submitAndNavigateToLoanAccountDetailsPage();
loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
return loanAccountPage;
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class LoanTestHelper method createLoanAccountForMultipleClientsInGroup.
/**
* Creates a loan account.
* @param loanSaveType : True - submit for approval, False - save for later
* @return LoanAccountPage
*/
public LoanAccountPage createLoanAccountForMultipleClientsInGroup(boolean loanSaveType) {
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = this.navigateToCreateLoanAccountEntryPage(searchParameters);
List<GLIMClient> clients = new ArrayList<GLIMClient>();
clients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 \n Client Id: 0002-000000012", "9999.9", "0009-Horse"));
clients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 \n Client Id: 0002-000000013", "99999.9", "0001-Cow Purchase"));
clients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 \n Client Id: 0002-000000014", "99999.9", "0003-Goat Purchase"));
List<GLIMClient> clients2 = new ArrayList<GLIMClient>();
clients2.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999.9", "0009-Horse"));
clients2.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999.9", "0001-Cow Purchase"));
clients2.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999.9", "0003-Goat Purchase"));
for (GLIMClient glimClient : clients2) {
loanAccountEntryPage.selectGLIMClients(glimClient.getClientNumber(), glimClient.getClientName(), glimClient.getLoanAmount(), glimClient.getLoanPurpose());
}
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage;
if (loanSaveType) {
createLoanAccountConfirmationPage = loanAccountEntryPage.submitAndNavigateToGLIMLoanAccountConfirmationPage();
} else {
createLoanAccountConfirmationPage = loanAccountEntryPage.submitAndNavigateToGLIMLoanAccountConfirmationPageSaveForLaterButton();
}
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
if (loanSaveType) {
loanAccountPage.verifyLoanIsPendingApproval();
} else {
loanAccountPage.verifyLoanIsInPartialApplication();
}
EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
for (GLIMClient glimClient : clients) {
editLoanAccountInformationPage.verifyGLIMClient(glimClient.getClientNumber(), glimClient.getClientName(), glimClient.getLoanAmount(), glimClient.getLoanPurpose());
}
editLoanAccountInformationPage.navigateBack();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
return loanAccountPage;
}
Aggregations