Search in sources :

Example 1 with ApplyPaymentConfirmationPage

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"));
}
Also used : CreateCenterEnterDataPage(org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage) ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) ApplyChargesPage(org.mifos.test.acceptance.framework.client.ApplyChargesPage) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters) DateTime(org.joda.time.DateTime) ViewCenterChargesDetailPage(org.mifos.test.acceptance.framework.center.ViewCenterChargesDetailPage) MeetingParameters(org.mifos.test.acceptance.framework.center.MeetingParameters) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) ApplyPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 2 with ApplyPaymentConfirmationPage

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();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) ApplyPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 3 with ApplyPaymentConfirmationPage

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);
}
Also used : ApplyPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 4 with ApplyPaymentConfirmationPage

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;
}
Also used : ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) AccountActivityPage(org.mifos.test.acceptance.framework.loan.AccountActivityPage) ApplyPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Aggregations

ApplyPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage)4 ApplyPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentPage)3 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)3 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)2 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)2 Test (org.testng.annotations.Test)2 DateTime (org.joda.time.DateTime)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1 MeetingParameters (org.mifos.test.acceptance.framework.center.MeetingParameters)1 ViewCenterChargesDetailPage (org.mifos.test.acceptance.framework.center.ViewCenterChargesDetailPage)1 ApplyChargesPage (org.mifos.test.acceptance.framework.client.ApplyChargesPage)1 AccountActivityPage (org.mifos.test.acceptance.framework.loan.AccountActivityPage)1 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)1