use of org.mifos.test.acceptance.framework.loan.PaymentParameters 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.PaymentParameters in project head by mifos.
the class LoanTestHelper method makePayment.
public LoanAccountPage makePayment(DateTime paymentDate, String paymentAmount) throws UnsupportedEncodingException {
PaymentParameters paymentParameters = setPaymentParams(paymentAmount, paymentDate);
setApplicationTime(paymentDate).navigateBack();
LoanAccountPage loanAccountPage = new LoanAccountPage(selenium).navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(paymentParameters).submitAndNavigateToLoanAccountDetailsPage();
AccountActivityPage accountActivityPage = loanAccountPage.navigateToAccountActivityPage();
accountActivityPage.verifyLastTotalPaid(paymentAmount, 2);
accountActivityPage.navigateBack();
return loanAccountPage;
}
use of org.mifos.test.acceptance.framework.loan.PaymentParameters in project head by mifos.
the class ApplyAdjustmentGroupLoanTest method adjustmentWithCommaTest.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void adjustmentWithCommaTest() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.setDisbursalDate(new DateTime(2013, 2, 8, 15, 0, 0, 0));
loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null);
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null);
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
statusParameters.setNote("Test new GLIM");
loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
DisburseLoanParameters params = new DisburseLoanParameters();
params.setPaymentType(DisburseLoanParameters.CASH);
loanTestHelper.disburseLoan(loanId, params);
PaymentParameters paymentParameters = new PaymentParameters();
paymentParameters.setAmount("2500.0");
paymentParameters.setPaymentType(PaymentParameters.CASH);
paymentParameters.setTransactionDateDD("08");
paymentParameters.setTransactionDateMM("2");
paymentParameters.setTransactionDateYYYY("2013");
loanTestHelper.applyGroupPayment(loanId, paymentParameters);
loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmitGroupLoan("2500.0");
Assert.assertFalse(selenium.isTextPresent("stack trace"));
Assert.assertTrue(selenium.isTextPresent("2,500"));
}
use of org.mifos.test.acceptance.framework.loan.PaymentParameters in project head by mifos.
the class SavingsPaymentTest method makePaymentFromSavings.
private LoanAccountPage makePaymentFromSavings(String loanGlobalNum, String savingsGlobalNum, int amount) {
CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
loanSearchParams.setSearchString(loanGlobalNum);
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanGlobalNum);
ApplyPaymentPage applyPaymentPage = loanAccountPage.navigateToApplyPayment();
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setAmount(String.valueOf(amount));
paymentParams.setPaymentType(PaymentParameters.TRANSFER);
paymentParams.setSavingsAccountGlobalNum(savingsGlobalNum);
paymentParams.setTransactionDateDD("13");
paymentParams.setTransactionDateMM("03");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setSavingsAccountBalance(String.valueOf(SAVINGS_START_BALANCE));
paymentParams.setSavingsAccountMaxWithdrawalAmount(String.valueOf(0));
paymentParams.setSavingsAccountType("Voluntary");
paymentParams.setSavingsAccountName("MonthlyClientSavingsAccount");
ApplyPaymentConfirmationPage paymentConfirmationPage = applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParams);
return paymentConfirmationPage.submitAndNavigateToLoanAccountDetailsPage();
}
use of org.mifos.test.acceptance.framework.loan.PaymentParameters in project head by mifos.
the class LoanAccountOverdueInterestTest method verifyPayOverdueInstalment.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyPayOverdueInstalment() throws Exception {
SubmitFormParameters loanParameters = FormParametersHelper.getWeeklyLoanProductParameters();
loanParameters.setOfferingName("OverdueLoan");
loanProductTestHelper.defineNewLoanProduct(loanParameters);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Stu");
searchParameters.setLoanProduct("OverdueLoan");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
LoanAccountPage loanPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
String loanId = loanPage.getAccountId();
loanPage.changeAccountStatusToAccepted();
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setDisbursalDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
disburseParameters.setDisbursalDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
disburseParameters.setDisbursalDateYYYY(Integer.toString(systemDateTime.getYear()));
disburseParameters.setPaymentType(PaymentParameters.CASH);
loanTestHelper.disburseLoan(loanId, disburseParameters);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
systemDateTime = systemDateTime.plusDays(20);
dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
ViewRepaymentSchedulePage repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTablePrincipal(3, "17.3");
repaymentPage.verifyRepaymentScheduleTableInterest(3, "3.7 (0)");
repaymentPage.verifyRepaymentScheduleTablePrincipal(4, "17.4");
repaymentPage.verifyRepaymentScheduleTableInterest(4, "3.6 (0)");
PaymentParameters params = new PaymentParameters();
params.setTransactionDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
params.setTransactionDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
params.setTransactionDateYYYY(Integer.toString(systemDateTime.getYear()));
params.setPaymentType(PaymentParameters.CASH);
params.setAmount("4.2");
loanPage = repaymentPage.navigateToApplyPaymentPage().submitAndNavigateToApplyPaymentConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(3, "0");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(3, "3.7");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(5, "17.3");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(5, "0 (3.7)");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(6, "17.4");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(6, "3.1 (0.5)");
}
Aggregations