Search in sources :

Example 1 with ApplyGroupPaymentConfirmationPage

use of org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage in project head by mifos.

the class LoanTestHelper method applyGroupPayment.

public LoanAccountPage applyGroupPayment(String loanId, PaymentParameters paymentParams) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmationPage = applyGroupPaymentPage.submitAndNavigateToApplyGroupPaymentConfirmationPage(paymentParams, true);
    loanAccountPage = applyGroupPaymentConfirmationPage.submitAndNavigateToLoanAccountDetailsPage();
    return loanAccountPage;
}
Also used : ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage)

Example 2 with ApplyGroupPaymentConfirmationPage

use of org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage in project head by mifos.

the class LoanTestHelper method applyGroupIndividualClientPayment.

public LoanAccountPage applyGroupIndividualClientPayment(String loanId, PaymentParameters paymentParams) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmationPage = applyGroupPaymentPage.submitAndNavigateToApplyGroupPaymentConfirmationPage(paymentParams, false);
    loanAccountPage = applyGroupPaymentConfirmationPage.submitAndNavigateToLoanAccountDetailsPage();
    return loanAccountPage;
}
Also used : ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage)

Example 3 with ApplyGroupPaymentConfirmationPage

use of org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage in project head by mifos.

the class ApplyPaymentOnGLIMLoanAccountTest method checkApplyPaymentOnGLIMLoanAccount.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkApplyPaymentOnGLIMLoanAccount() throws Exception {
    LoanAccountPage loanAccountPage = createNewLoan();
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
    params.setNote("asd");
    params.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("04");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setAmount("140");
    applyGroupPaymentPage.verifyIndividualAmount(0, "20.0");
    applyGroupPaymentPage.verifyIndividualAmount(1, "40.0");
    applyGroupPaymentPage.verifyIndividualAmount(2, "80.0");
    //principal 25, less
    applyGroupPaymentPage.setIndividualAmount(0, "20");
    //principal 50, equal
    applyGroupPaymentPage.setIndividualAmount(1, "50");
    //principal 100, more
    applyGroupPaymentPage.setIndividualAmount(2, "120");
    applyGroupPaymentPage.verifyAmount("190");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setDate("04", "03", "2011");
    ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, EXPECTED_PAID_INSTALLMENTS);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    for (int i = 0; i <= 2; i += 1) {
        viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
        verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, INDIVIDUAL_EXPECTED_PAID_INSTALLMENTS[i]);
        loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    }
    // Test applying payment for last installment
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setAmount("1500");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    // Last installment left to payoff whole account
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.verifyAmount("60.0");
    applyGroupPaymentPage.verifyIndividualAmount(0, "15.7");
    applyGroupPaymentPage.verifyIndividualAmount(1, "21.4");
    applyGroupPaymentPage.verifyIndividualAmount(2, "22.9");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage) Test(org.testng.annotations.Test)

Aggregations

ApplyGroupPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage)3 ApplyGroupPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage)3 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)3 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)2 AccountChangeStatusPage (org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)1 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)1 Test (org.testng.annotations.Test)1