use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class LoanTestHelper method createActivateDisburstAndApplyPaymentForDefaultLoanAccount.
public LoanAccountPage createActivateDisburstAndApplyPaymentForDefaultLoanAccount(String clientName, String dd, String mm, String yy) {
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString(clientName);
searchParams.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD(dd);
disburseParams.setDisbursalDateMM(mm);
disburseParams.setDisbursalDateYYYY(yy);
disburseParams.setPaymentType(PaymentParameters.CASH);
disburseParams.setAmount("10,000");
LoanAccountPage loanAccountPage = createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
String accountID = loanAccountPage.getAccountId();
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setTransactionDateDD(dd);
paymentParams.setTransactionDateMM(mm);
paymentParams.setTransactionDateYYYY(yy);
paymentParams.setPaymentType(PaymentParameters.CASH);
paymentParams.setAmount("1");
paymentParams.setReceiptId("");
paymentParams.setReceiptDateDD("");
paymentParams.setReceiptDateMM("");
paymentParams.setReceiptDateYYYY("");
return applyPayment(accountID, paymentParams);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class ApplyPaymentOnGLIMLoanAccountTest method checkApplyPaymentOnGLIMLoanAccount.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkApplyPaymentOnGLIMLoanAccount() throws Exception {
LoanAccountPage loanAccountPage = createNewLoan();
AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
params.setNote("asd");
params.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("04");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.setAmount("140");
applyGroupPaymentPage.verifyIndividualAmount(0, "20.0");
applyGroupPaymentPage.verifyIndividualAmount(1, "40.0");
applyGroupPaymentPage.verifyIndividualAmount(2, "80.0");
//principal 25, less
applyGroupPaymentPage.setIndividualAmount(0, "20");
//principal 50, equal
applyGroupPaymentPage.setIndividualAmount(1, "50");
//principal 100, more
applyGroupPaymentPage.setIndividualAmount(2, "120");
applyGroupPaymentPage.verifyAmount("190");
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentPage.setDate("04", "03", "2011");
ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, EXPECTED_PAID_INSTALLMENTS);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
for (int i = 0; i <= 2; i += 1) {
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, INDIVIDUAL_EXPECTED_PAID_INSTALLMENTS[i]);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
}
// Test applying payment for last installment
applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentPage.setAmount("1500");
applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
// Last installment left to payoff whole account
applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
applyGroupPaymentPage.verifyAmount("60.0");
applyGroupPaymentPage.verifyIndividualAmount(0, "15.7");
applyGroupPaymentPage.verifyIndividualAmount(1, "21.4");
applyGroupPaymentPage.verifyIndividualAmount(2, "22.9");
applyGroupPaymentPage.setPaymentMethod("1");
applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class CreateGLIMLoanAccountWithOneTimeFeeTest method checkGLIMLoanWithThreeClientsCreeatedCorrectly.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMLoanWithThreeClientsCreeatedCorrectly() throws Exception {
LoanAccountPage loanAccountPage = createLoan();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("10");
loanAccountPage.verifyDisbursalDate("04/03/2011");
loanAccountPage.verifyPrincipalOriginal("1,000");
loanAccountPage.verifyLoanTotalBalance("1,043");
loanAccountPage.verifyFeesOriginal("1");
loanAccountPage.verifyInterestOriginal("42");
Assert.assertTrue(selenium.isTextPresent("oneTimeFee: 1"));
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS, EXPECTED_INTERESTS, EXPECTED_FEES, EXPECTED_TOTALS);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
params.setNote("asd");
params.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("04");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(0).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT1, EXPECTED_INTERESTS_CLIENT1, EXPECTED_FEES_CLIENT1, EXPECTED_TOTALS_CLIENT1);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(1).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT2, EXPECTED_INTERESTS_CLIENT2, EXPECTED_FEES_CLIENT2, EXPECTED_TOTALS_CLIENT2);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(2).navigateToRepaymentSchedulePage();
verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT3, EXPECTED_INTERESTS_CLIENT3, EXPECTED_FEES_CLIENT3, EXPECTED_TOTALS_CLIENT3);
loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
loanAccountPage = clientRepayLoan(loanAccountPage, 0);
loanAccountPage = clientRepayLoan(loanAccountPage, 1);
loanAccountPage = clientRepayLoan(loanAccountPage, 2);
loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class QuestionGroupLoanAccountTest method verifyResponsesDuringLoanAccountClosing.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringLoanAccountClosing() throws Exception {
questionGroupTestHelper.markQuestionGroupAsActive("QGForCloseLoan");
try {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu12332659912419 Client12332659912419");
searchParams.setLoanProduct(productParams.getOfferingName());
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
disburseParams.setDisbursalDateDD("24");
disburseParams.setDisbursalDateMM("02");
disburseParams.setDisbursalDateYYYY("2011");
loanProductTestHelper.defineNewLoanProduct(productParams);
LoanAccountPage loanAccountPage = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
String loanID1 = loanAccountPage.getAccountId();
QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
String[] questionsExist = { "Date", "FreeText" };
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("Date", "04/02/2011");
questionsAndAnswers.put("FreeText", "free text");
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_CLOSED_WRITTENOFF);
editAccountStatusParameters.setNote("note note");
QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID1, editAccountStatusParameters);
questionResponsePage.verifyQuestionsExists(questionsExist);
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().submitAndNavigateToLoanAccountPage();
verifyQuestionResponsesExistInDatabase(loanID1, "Close Loan", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCloseLoan");
}
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class QuestionGroupLoanAccountTest method verifyCapturingResponsesDuringLoanDisburse.
/**
* Capturing responses during the Loan disburse
* http://mifosforge.jira.com/browse/MIFOSTEST-668
*
* @throws Exception
*/
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyCapturingResponsesDuringLoanDisburse() throws Exception {
questionGroupTestHelper.markQuestionGroupAsActive("QGForDisburseLoan1");
questionGroupTestHelper.markQuestionGroupAsActive("QGForDisburseLoan2");
try {
CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
disburseLoanParameters.setPaymentType(DisburseLoanParameters.CASH);
disburseLoanParameters.setDisbursalDateDD("24");
disburseLoanParameters.setDisbursalDateMM("02");
disburseLoanParameters.setDisbursalDateYYYY("2011");
QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "free text1");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "07/02/2011");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "20");
questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].valuesAsArray", "three");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(createLoanAccountSearchParameters);
String loan1ID = loanAccountPage.getAccountId();
loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(createLoanAccountSearchParameters);
String loan2ID = loanAccountPage.getAccountId();
QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanDisbursal(loan1ID, disburseLoanParameters);
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage = questionResponsePage.continueAndNavigateToDisburseLoanConfirmationPage().navigateToEditAdditionalInformation();
questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage.continueAndNavigateToDisburseLoanConfirmationPage().submitAndNavigateToLoanAccountPage();
CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
createQuestionParameters.setText("createdByverifyCapturingResponsesDuringLoanDisburse");
List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
newQuestionList.add(createQuestionParameters);
String[] questionsExist = { "Date", "FreeText", "SingleSelect", "createdByverifyCapturingResponsesDuringLoanDisburse" };
String[] questionsInactive = { "ToBeDisabled" };
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("MultiSelect", "three");
questionsAndAnswers.put("Number", "20");
questionsAndAnswers.put("Date", "04/02/2011");
questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan2");
questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForDisburseLoan1", newQuestionList);
questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanDisbursal(loan2ID, disburseLoanParameters);
questionResponsePage.verifyQuestionsExists(questionsExist);
questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
verifyQuestionResponsesExistInDatabase(loan1ID, "Disburse Loan", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan1");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForDisburseLoan2");
}
}
Aggregations