use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.
@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
String questionGroupTitle = "QG1" + random.nextInt(100);
String question1 = "DT_" + random.nextInt(100);
String question2 = "SS_" + random.nextInt(100);
String answer = "01/01/2010";
String choiceAnswer = "Choice2";
questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("client1 lastname");
searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
QuestionResponseParameters parameters = new QuestionResponseParameters();
parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
questionResponseDetailPage.verifyPage();
questionResponseDetailPage.verifyQuestionPresent(question1, answer);
questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
questionResponseDetailPage.navigateToDetailsPage();
questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class CreateClientLoanAccountTest method tryClientLoanAccountWithAdditionalFees.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void tryClientLoanAccountWithAdditionalFees() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client - Mary Monthly");
searchParameters.setLoanProduct("EmergencyLoanWithZeroInterest");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.selectAdditionalFees();
// there should be an error
loanAccountEntryPage.submitAndWaitForPage();
loanAccountEntryPage.verifyError("Multiple instances of the same fee are not allowed.");
// after unselect everything should pass
loanAccountEntryPage.unselectAdditionalFee();
loanAccountEntryPage.clickContinue();
HomePage homePage = loanAccountEntryPage.navigateToHomePage();
homePage.verifyPage();
loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(searchParameters);
loanAccountEntryPage.verifyAdditionalFeesAreEmpty();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class CreateClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSameWeekAndWeekdayOfMonth.
@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // (1,4,'test' to (1,4,'test','2011-02-01'
void newMonthlyClientLoanAccountWithMeetingOnSameWeekAndWeekdayOfMonth() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client - Mia Monthly3rdFriday");
searchParameters.setLoanProduct("MonthlyClientFlatLoanThirdFridayOfMonth");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("2765.0");
submitAccountParameters.setGracePeriodTypeNone(true);
//Then
String loanId = createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
getLoanStatusActive(loanId);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class FeeTest method applyAndRemoveFees.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyAndRemoveFees() throws Exception {
// this account has an approved but not disbursed loan.
String pendingApprovalAccountId = "000100000000043";
String partialApplicationAccountId = "000100000000044";
String applicationApprovedAccountId = "000100000000045";
String client = "WeeklyClient Monday";
String oneTimeFee = feeTestHelper.createNoRateFee("oneTimeFee", FeesCreatePage.SubmitFormParameters.LOAN, "Upfront", 10);
String periodicFee = feeTestHelper.createPeriodicRateFee("periodicFee", FeesCreatePage.SubmitFormParameters.LOAN, FeesCreatePage.SubmitFormParameters.PERIODIC_FEE_FREQUENCY, 1, 10, FeesCreatePage.SubmitFormParameters.LOAN_AMOUNT);
ChargeParameters feeParameters = new ChargeParameters();
feeParameters.setAmount("10");
feeParameters.setType(oneTimeFee);
// ONE TIME FEE
// add and remove the fee from a pending approval account
loanTestHelper.applyChargeUsingFeeLabel(pendingApprovalAccountId, feeParameters);
loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
loanTestHelper.removeOneTimeFee(1);
loanTestHelper.verifyNoOneTimeFeesExist();
// add and remove the fee from a partial application account
loanTestHelper.applyChargeUsingFeeLabel(partialApplicationAccountId, feeParameters);
loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
loanTestHelper.removeOneTimeFee(1);
loanTestHelper.verifyNoOneTimeFeesExist();
// add and verify that the fee cannot be removed from an application approved account
loanTestHelper.applyChargeUsingFeeLabel(applicationApprovedAccountId, feeParameters);
loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
loanTestHelper.verifyNoOneTimeFeeRemovalLinkExists(1);
// PERIODIC FEE
feeParameters.setType(periodicFee);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString(client);
searchParams.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("28");
disburseParams.setDisbursalDateMM("02");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(PaymentParameters.CASH);
disburseParams.setAmount("10,000");
// add and verify that the fee can be removed from an application approved account
loanTestHelper.applyChargeUsingFeeLabel("000100000000047", feeParameters);
loanTestHelper.verifyNoPeriodicFee(periodicFee, 1);
loanTestHelper.removePeriodicFee(1);
// add and verify that the fee can't be removed from an application approved account
// after repay of first instalment
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setTransactionDateDD("28");
paymentParams.setTransactionDateMM("02");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setPaymentType(PaymentParameters.CASH);
paymentParams.setAmount("3000");
paymentParams.setReceiptId("");
paymentParams.setReceiptDateDD("");
paymentParams.setReceiptDateMM("");
paymentParams.setReceiptDateYYYY("");
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 28, 12, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
String accountWithDisburs = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams).getAccountId();
loanTestHelper.applyChargeUsingFeeLabel(accountWithDisburs, feeParameters);
loanTestHelper.applyPayment(accountWithDisburs, paymentParams);
loanTestHelper.removePeriodicFee(1);
loanTestHelper.verifyValidationErrorAppear();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class CreateGLIMLoanAccountTest method checkGLIMIndividualSchedule.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMIndividualSchedule() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999", "0012-Sheep Purchase");
loanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999");
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999");
LoanAccountPage loanAccountPage = loanAccountEntryPage.navigateToReviewInstallmentsPage().clickPreviewAndGoToReviewLoanAccountPage().submitForApprovalAndNavigateToConfirmationPage().navigateToLoanAccountDetailsPage();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
EditLoanAccountStatusParameters statusParams = new EditLoanAccountStatusParameters();
statusParams.setNote("GLIM test");
statusParams.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage.changeAccountStatus(statusParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
String loanId = loanAccountPage.getAccountId();
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setAmount("209997.0");
disburseParams.setDisbursalDateDD("8");
disburseParams.setDisbursalDateMM("3");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage.disburseLoan(disburseParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setAmount("1500.0");
paymentParams.setTransactionDateDD("8");
paymentParams.setTransactionDateMM("3");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setPaymentType(PaymentParameters.CASH);
loanTestHelper.applyPayment(loanId, paymentParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmit("1500.0");
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
String[] expectedPrincipalAmounts = new String[] { "24.9", "249.2", "249.3" };
String[] expectedInterestAmounts = new String[] { "46", "460.3", "460.3" };
String[] expectedFeeAmounts = new String[] { "0.5", "4.8", "4.7" };
verifyProRatedGLIMPayments(loanAccountPage, 3, expectedPrincipalAmounts, expectedInterestAmounts, expectedFeeAmounts);
loanTestHelper.repayLoan(loanId);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
loanAccountPage.navigateToApplyAdjustment().submitAdjustment();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
statusParams.setNote("GLIM test");
statusParams.setStatus(EditLoanAccountStatusParameters.CLOSED_WRITTEN_OFF);
loanAccountPage.changeAccountStatus(statusParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
}
Aggregations