use of org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage 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.ApplyPaymentConfirmationPage 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.ApplyPaymentConfirmationPage 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.ApplyPaymentConfirmationPage in project head by mifos.
the class LoanTestHelper method applyPayment.
/**
* Applies a payment to the loan account with id <tt>loanId</tt>.
* @param loanId The account id.
* @param paymentParams The payment parameters.
* @return The loan account page for the loan account.
*/
public LoanAccountPage applyPayment(String loanId, PaymentParameters paymentParams) {
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
ApplyPaymentPage applyPaymentPage = loanAccountPage.navigateToApplyPayment();
ApplyPaymentConfirmationPage applyPaymentConfirmationPage = applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParams);
loanAccountPage = applyPaymentConfirmationPage.submitAndNavigateToLoanAccountDetailsPage();
AccountActivityPage accountActivityPage = loanAccountPage.navigateToAccountActivityPage();
accountActivityPage.verifyLastTotalPaid(paymentParams.getAmount(), 2);
accountActivityPage.navigateBack();
return loanAccountPage;
}
Aggregations