Search in sources :

Example 1 with PaymentParameters

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"));
}
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 PaymentParameters

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

Example 3 with PaymentParameters

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"));
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 4 with PaymentParameters

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();
}
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 5 with PaymentParameters

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)");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Aggregations

PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)18 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)9 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)7 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)7 Test (org.testng.annotations.Test)6 DateTime (org.joda.time.DateTime)5 ApplyPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentPage)4 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)4 ApplyPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage)3 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)3 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)3 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)2 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)2 LocalDate (org.joda.time.LocalDate)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)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