use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.
the class LoanAccountCycleTest method verifyAmountByCycleAndInstallmentsByLastAmount.
/**
* Verify loan amount with number of installments by last loan amount can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-110
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountByCycleAndInstallmentsByLastAmount() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product110");
productParams.setOfferingShortName("p110");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] cycleLoanAmount = getAmountsByCycle();
productParams.setCycleLoanAmount(cycleLoanAmount);
productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] calculateInstallments = getInstallmentsFromLastAmount();
productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product110");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "5", "10", "5" });
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "5", "10", "5" });
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "10", "30", "25" });
}
use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.
the class LoanAccountCycleTest method verifyNumberOfInstallmentsSameForAllLoans.
/**
* Verify loan amount with number of installments is same for all loan can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-105
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyNumberOfInstallmentsSameForAllLoans() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("LastCycleBasedProduct");
productParams.setOfferingShortName("p105");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] cycleLoanAmount = getAmountsByCycle();
productParams.setCycleLoanAmount(cycleLoanAmount);
productParams.setMinInstallemnts("10");
productParams.setMaxInstallments("100");
productParams.setDefInstallments("50");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("LastCycleBasedProduct");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
loanProductDetailsPage.verifyInstallments("10", "100", "50");
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "10", "100", "50" });
String loan1ID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "10", "100", "50" });
String loan2ID = loanAccountPage.getAccountId();
loanTestHelper.repayLoan(loan1ID);
loanTestHelper.disburseLoan(loan2ID, disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "3,000", "7,000", "5000.0" }, null, new String[] { "10", "100", "50" });
}
use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.
the class LoanAccountCycleTest method verifyProductCreationWhenInstallmentsByLastAmount.
/**
* Verify the loan product creation for the new loan product when
* the "Calculate Loan Amount as:" " same for all loans." and
* "Calculate # of Installments as:" "by last loan amount"
* http://mifosforge.jira.com/browse/MIFOSTEST-101
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProductCreationWhenInstallmentsByLastAmount() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("LastAmountBasedProduct");
productParams.setOfferingShortName("p101");
productParams.setMinLoanAmount("1000.0");
productParams.setMaxLoanAmount("7000.0");
productParams.setDefaultLoanAmount("2000.0");
productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] calculateInstallments = getInstallmentsFromLastAmount();
productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
loanProductDetailsPage.verifyLoanAmountTableTypeSame("1000.0", "7000.0", "2000.0");
}
use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.
the class LoanAccountCycleTest method verifyAmountsByLastAmountAndInstallmentsByCycle.
/**
* Verify loan amount with number of installments by loan cycle can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-114
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountsByLastAmountAndInstallmentsByCycle() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product114");
productParams.setOfferingShortName("p114");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] lastLoanAmount = getAmountsFromLastAmount();
productParams.setAmountsByLastLoanAmount(lastLoanAmount);
productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] calculateInstallments = getInstallmentsByCycle();
productParams.setCycleInstallments(calculateInstallments);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product114");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(calculateInstallments);
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "26", "52", "52" });
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "20", "30", "30" });
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, new String[] { "20", "30", "30" });
}
use of org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage in project head by mifos.
the class LoanAccountCycleTest method verifyAmountByLastAmountAndInstallmentsSameForAll.
/**
* Verify loan amount with number of installments is same for all loan can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-112
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountByLastAmountAndInstallmentsSameForAll() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product112");
productParams.setOfferingShortName("p112");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] lastLoanAmount = getAmountsFromLastAmount();
productParams.setAmountsByLastLoanAmount(lastLoanAmount);
productParams.setMinInstallemnts("10");
productParams.setMaxInstallments("100");
productParams.setDefInstallments("50");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product112");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
loanProductDetailsPage.verifyInstallments("10", "100", "50");
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, null);
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, null);
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, null);
}
Aggregations