use of org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage in project head by mifos.
the class CreateClientLoanAccountTest method verifyCreatingLoanAccountsOnProductWithLoanCycles.
/**
* Verify the loan product created with default number of installments
* by loan cycle can be used to create new loans accounts.
* http://mifosforge.jira.com/browse/MIFOSTEST-99
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCreatingLoanAccountsOnProductWithLoanCycles() throws Exception {
setAppDate(new DateTime(2011, 1, 24, 15, 0, 0, 0));
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("ProdTest99");
productParams.setOfferingShortName("T99");
productParams.setMinLoanAmount("1000");
productParams.setMaxLoanAmount("10000");
productParams.setDefaultLoanAmount("5000");
productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] cycleInstallments = { { "26", "52", "52" }, { "20", "30", "30" }, { "15", "25", "25" }, { "10", "15", "15" }, { "5", "10", "10" }, { "1", "5", "5" } };
productParams.setCycleInstallments(cycleInstallments);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu12332659912419 Client12332659912419");
searchParams.setLoanProduct("ProdTest99");
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
disburseParams.setDisbursalDateDD("24");
disburseParams.setDisbursalDateMM("01");
disburseParams.setDisbursalDateYYYY("2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyLoanAmountTableTypeSame("1,000", "10,000", "5,000");
loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(cycleInstallments);
LoanAccountPage loanAccountPage = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
loanAccountPage.verifyNumberOfInstallments("26", "52", "52");
String loan1ID = loanAccountPage.getAccountId();
loanTestHelper.repayLoan(loan1ID);
loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
//extension MIFOSTEST-1186
loanAccountPage.navigateToViewLoanAccountActivityPage();
loanAccountPage.verifyPage("ViewLoanAccountActivity");
Assert.assertEquals(selenium.getTable("accountActivityTable.2.1"), "Loan Disbursal");
Assert.assertEquals(selenium.getTable("accountActivityTable.2.2"), "5,000");
Assert.assertEquals(selenium.getTable("accountActivityTable.2.11"), "5,288");
loanAccountPage.navigateBack();
loanAccountPage.verifyNumberOfInstallments("20", "30", "30");
String loan2ID = loanAccountPage.getAccountId();
loanTestHelper.repayLoan(loan2ID);
loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
loanAccountPage.verifyNumberOfInstallments("15", "25", "25");
// extension to verify MIFOS-5005
DisburseLoanConfirmationPage disburseLoanConfirmationPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams).navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseParams);
disburseLoanConfirmationPage.submitButDisbursalFailed("This loan cannot be disbursed because the customer already has an active loan for this loan product.");
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanConfirmationPage in project head by mifos.
the class LoanTestHelper method disburseLoan.
/**
* Disburses the loan with id <tt>loanId</tt>.
* @param loanId The system/global id of the loan that'll be disbursed.
* @param disburseParameters The disbursal parameters.
* @return The loan account page of the loan account with id loanId.
*/
public LoanAccountPage disburseLoan(String loanId, DisburseLoanParameters disburseParameters) {
DisburseLoanPage disburseLoanPage = prepareToDisburseLoan(loanId);
DisburseLoanConfirmationPage disburseLoanConfirmationPage = disburseLoanPage.submitAndNavigateToDisburseLoanConfirmationPage(disburseParameters);
LoanAccountPage loanAccountPage = disburseLoanConfirmationPage.submitAndNavigateToLoanAccountPage();
loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
return loanAccountPage;
}
Aggregations