use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class CenterTest method verifyApplyPaymentForCenterWithUnusualName.
@Test(enabled = true)
public void verifyApplyPaymentForCenterWithUnusualName() {
String centerName = "`~!@#$%^&*()_+-=[];',./{}|:<>? Center";
CreateCenterEnterDataPage.SubmitFormParameters formParameters = new CreateCenterEnterDataPage.SubmitFormParameters();
formParameters.setCenterName(centerName);
formParameters.setLoanOfficer("loan officer");
MeetingParameters meeting = MeetingParameters.getRandomMeetingParameters();
formParameters.setMeeting(meeting);
centerTestHelper.createCenter(formParameters, "MyOfficeDHMFT");
NavigationHelper navigationHelper = new NavigationHelper(selenium);
ViewCenterChargesDetailPage viewCenterChargesDetailPage = navigationHelper.navigateToCenterViewDetailsPage(centerName).navigateToViewCenterChargesDetailPage();
ApplyChargesPage applyChargesPage = viewCenterChargesDetailPage.navigateToApplyCharges();
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setAmount("100");
chargeParameters.setType(ChargeParameters.MISC_FEES);
viewCenterChargesDetailPage = applyChargesPage.applyChargeAndNaviagteToViewCenterChargesDetailPage(chargeParameters);
ApplyPaymentPage applyPaymentPage = viewCenterChargesDetailPage.navigateToApplyPayments();
PaymentParameters parameters = new PaymentParameters();
DateTime dateTime = new DateTime();
parameters.setAmount("100");
parameters.setTransactionDateDD(Integer.toString(dateTime.getDayOfMonth()));
parameters.setTransactionDateMM(Integer.toString(dateTime.getMonthOfYear()));
parameters.setTransactionDateYYYY(Integer.toString(dateTime.getYear()));
parameters.setPaymentType(PaymentParameters.CASH);
ApplyPaymentConfirmationPage applyPaymentConfirmationPage = applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(parameters);
//ElementPresent("css=form[name=applyPaymentActionForm]"));
Assert.assertEquals(true, applyPaymentConfirmationPage.getSelenium().isTextPresent("Review transaction"));
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class DecliningPrincipleLoanTest method setCharge.
private ChargeParameters setCharge() {
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
return chargeParameters;
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters 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.ChargeParameters in project head by mifos.
the class ClientTest method createClientAddTwoFeesTryPayMoreThanAmountVerifyErrorMessage.
@Test(enabled = true)
public // http://mifosforge.jira.com/browse/MIFOS-4776
void createClientAddTwoFeesTryPayMoreThanAmountVerifyErrorMessage() {
String oneTimeFeeName = "One Time Fee";
String periodicTimeFee = "Periodic Time Fee";
defineNewFree(oneTimeFeeName, SubmitFormParameters.ONETIME_FEE_FREQUENCY, 10.0);
defineNewFree(periodicTimeFee, SubmitFormParameters.PERIODIC_FEE_FREQUENCY, 37.0);
String clientName = "Stu1233266299995 Client1233266299995";
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setAmount("10");
chargeParameters.setType(oneTimeFeeName);
clientTestHelper.applyCharge(clientName, chargeParameters);
chargeParameters.setAmount("37");
chargeParameters.setType(periodicTimeFee);
clientTestHelper.applyCharge(clientName, chargeParameters);
PaymentParameters params = new PaymentParameters();
params.setTransactionDateDD("11");
params.setTransactionDateMM("02");
params.setTransactionDateYYYY("2009");
params.setAmount("48");
params.setPaymentType(PaymentParameters.CASH);
params.setReceiptId("");
params.setReceiptDateDD("");
params.setReceiptDateMM("");
params.setReceiptDateYYYY("");
ApplyPaymentConfirmationPage applyPaymentConfirmationPage = clientTestHelper.navigateToClientViewDetailsPage(clientName).navigateToViewClientChargesDetail().navigateToApplyPayments().submitAndNavigateToApplyPaymentConfirmationPage(params);
applyPaymentConfirmationPage.dontLoadNext();
String actual = applyPaymentConfirmationPage.getSelenium().getText("//span[@id='reviewapplypayment.error.message']");
String expected = "Payment cannot be more than Amount due.";
Assert.assertEquals(expected, actual);
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class CreateClientLoanAccountTest method verifyAccountFromProductInstallmentsSame.
/**
* Verify loan product created with default loan amount and number of installments
* are "same for all loans" can be used to create new loan accounts with the correct default amounts.
* http://mifosforge.jira.com/browse/MIFOSTEST-97
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public //CreateClient: weekly, Stu12332659912419 Client12332659912419, monday, activate
void verifyAccountFromProductInstallmentsSame() throws Exception {
setAppDate(new DateTime(2011, 1, 24, 15, 0, 0, 0));
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("ProdTest97");
productParams.setOfferingShortName("T97");
productParams.setMinLoanAmount("1000");
productParams.setMaxLoanAmount("10000");
productParams.setDefaultLoanAmount("5000");
productParams.setMinInstallemnts("10");
productParams.setMaxInstallments("100");
productParams.setDefInstallments("50");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu12332659912419 Client12332659912419");
searchParams.setLoanProduct("ProdTest97");
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
disburseParams.setDisbursalDateDD("24");
disburseParams.setDisbursalDateMM("01");
disburseParams.setDisbursalDateYYYY("2011");
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(ChargeParameters.MISC_FEES);
chargeParameters.setAmount("599.0");
LoanAccountPage loanAccountPage = loanTestHelper.createProductAndThenAccount(productParams, searchParams, disburseParams);
loanAccountPage.verifyNumberOfInstallments("10", "100", "50");
loanAccountPage.verifyPrincipalBalance("5,000");
loanTestHelper.applyOneChargeOnLoanAccount(chargeParameters);
loanAccountPage.navigateToViewInstallmentDetails().verifyInstallmentAmount(4, 1, "599");
}
Aggregations