Search in sources :

Example 16 with LoanAccountPage

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

the class LoanTestHelper method prepareToDisburseLoanWithoutLogout.

public DisburseLoanPage prepareToDisburseLoanWithoutLogout(HomePage homePage, String loanId) {
    SearchResultsPage searchResultsPage = homePage.search(loanId);
    searchResultsPage.verifyPage();
    LoanAccountPage loanAccountPage = searchResultsPage.navigateToLoanAccountDetailPage(loanId);
    return loanAccountPage.navigateToDisburseLoan();
}
Also used : RedoLoanDisbursalSearchResultsPage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSearchResultsPage) ClientSearchResultsPage(org.mifos.test.acceptance.framework.client.ClientSearchResultsPage) SearchResultsPage(org.mifos.test.acceptance.framework.search.SearchResultsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 17 with LoanAccountPage

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

the class LoanTestHelper method verifyLastEntryInStatusHistory.

public void verifyLastEntryInStatusHistory(String loanId, String oldStatus, String newStatus) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    ViewLoanStatusHistoryPage viewLoanStatusHistoryPage = loanAccountPage.navigateToViewLoanStatusHistoryPage();
    viewLoanStatusHistoryPage.verifyLastEntryInStatusHistory(oldStatus, newStatus);
}
Also used : ViewLoanStatusHistoryPage(org.mifos.test.acceptance.framework.loan.ViewLoanStatusHistoryPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)

Example 18 with LoanAccountPage

use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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 19 with LoanAccountPage

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

the class PenaltyHelper method verifyCalculatePenaltyWithoutPayment.

public void verifyCalculatePenaltyWithoutPayment(final String accountId, final String[] summaryPenalty, final String[][] schedulePenalty, final String[] accountSummary) {
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(accountId);
    verifyCalculatePenaltyOnLoanAccountScreen(loanAccountPage, summaryPenalty, accountSummary);
    ViewRepaymentSchedulePage repaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    for (int i = 0; i < schedulePenalty.length; ++i) {
        if (schedulePenalty[i] != null) {
            repaymentSchedulePage.verifyInstallmentAmount(4 + i, 7, schedulePenalty[i][0]);
            repaymentSchedulePage.verifyInstallmentAmount(4 + i, 9, schedulePenalty[i][1]);
        }
    }
}
Also used : ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 20 with LoanAccountPage

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

the class ViewOriginalLoanScheduleTest method verifyForVariableInstallmentLoanEarlyDisbursal.

// http://mifosforge.jira.com/browse/MIFOSTEST-1163
//blocked by http://mifosforge.jira.com/browse/MIFOS-5026 - ldomzalski
@Test(enabled = false)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyForVariableInstallmentLoanEarlyDisbursal() throws Exception {
    //Given
    int interestType = DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE;
    DateTime disbursalDate = systemDateTime.plusDays(1);
    applicationDatabaseOperation.updateLSIM(1);
    DefineNewLoanProductPage.SubmitFormParameters formParameters = defineLoanProductParameters(interestType);
    CreateLoanAccountSubmitParameters accountSubmitParameters = new CreateLoanAccountSubmitParameters();
    accountSubmitParameters.setAmount("1000.0");
    accountSubmitParameters.setInterestRate("20");
    accountSubmitParameters.setNumberOfInstallments("5");
    accountSubmitParameters.setDd("11");
    accountSubmitParameters.setMm("10");
    accountSubmitParameters.setYy("2011");
    String[] fees = { "fixedFeePerAmountAndInterest", "fixedFeePerInterest" };
    EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
    editAccountParameters.setGracePeriod("0");
    formParameters.addFee("fixedFeePerAmountAndInterest");
    formParameters.addFee("fixedFeePerInterest");
    //When
    DefineNewLoanProductPage defineNewLoanProductPage = loanProductTestHelper.navigateToDefineNewLoanPageAndFillMandatoryFields(formParameters).fillVariableInstalmentOption("30", "1", "100");
    defineNewLoanProductPage.submitWithErrors("fee cannot be applied to variable installment loan product");
    defineNewLoanProductPage.setInterestRateType(DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION);
    defineNewLoanProductPage.submitWithErrors("The selected interest type is invalid for variable installment loan product");
    defineNewLoanProductPage.setInterestRateType(interestType);
    defineNewLoanProductPage.submitAndGotoNewLoanProductPreviewPage().submit();
    List<String> errors = new ArrayList<String>();
    errors.add("fixedFeePerAmountAndInterest fee cannot be applied to loan with variable installments");
    errors.add("fixedFeePerInterest fee cannot be applied to loan with variable installments.");
    navigationHelper.navigateToHomePage();
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(disbursalDate).applyAdditionalFees(fees).submitWithErrors(errors).unselectAdditionalFees().clickContinue();
    createLoanAccountReviewInstallmentPage.isDueDatesEditable(Integer.parseInt(formParameters.getDefInstallments()));
    createLoanAccountReviewInstallmentPage.isTotalsEditable(Integer.parseInt(formParameters.getDefInstallments()));
    String total = createLoanAccountReviewInstallmentPage.getTotalForInstallment(1);
    createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, "3");
    createLoanAccountReviewInstallmentPage.submitWithErrors("has total amount less than the sum of interest and fees");
    createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, "5");
    createLoanAccountReviewInstallmentPage.submitWithErrors("has total amount less than the allowed value");
    createLoanAccountReviewInstallmentPage.setTotalForInstallment(1, total);
    createLoanAccountReviewInstallmentPage.validate();
    Calendar calendar = Calendar.getInstance();
    calendar.set(2011, 9, 13);
    String prevDueDate = createLoanAccountReviewInstallmentPage.getDueDateForInstallment(1);
    createLoanAccountReviewInstallmentPage.typeInstallmentDueDateByPicker(1, calendar);
    createLoanAccountReviewInstallmentPage.setDueDateForInstallment(1, prevDueDate);
    prevDueDate = createLoanAccountReviewInstallmentPage.getDueDateForInstallment(5);
    createLoanAccountReviewInstallmentPage.setDueDateForInstallment(5, "07/11/11");
    createLoanAccountReviewInstallmentPage.submitWithErrors("Gap between the due dates of installment 5 and the previous installment is less than allowed");
    createLoanAccountReviewInstallmentPage.setDueDateForInstallment(5, prevDueDate);
    List<String> totals = createLoanAccountReviewInstallmentPage.getTotalsInstallments(Integer.parseInt(formParameters.getDefInstallments()));
    List<String> dueDates = createLoanAccountReviewInstallmentPage.getDueDatesInstallments(Integer.parseInt(formParameters.getDefInstallments()));
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    createLoanAccountPreviewPage.verifyInstallmentsSchedule(totals, dueDates, Integer.parseInt(formParameters.getDefInstallments()));
    LoanAccountPage loanAccountPage = createLoanAccountPreviewPage.submit().navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyDisbursalDate(disbursalDate);
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyScheduleAndAmounts(totals, dueDates);
    viewRepaymentSchedulePage.navigateBack();
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    editLoanAccountInformationPage.verifyAccountParams(accountSubmitParameters, editAccountParameters);
    editLoanAccountInformationPage.navigateBack();
    loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    loanTestHelper.approveLoan();
    loanTestHelper.disburseLoan(systemDateTime);
    String[][] tableOnOriginalInstallment = OriginalScheduleData.VARIABLE_LOAN_EARLY_DISBURSAL_SCHEDULE;
    verifyOriginalSchedule(tableOnOriginalInstallment);
    loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    verifyOriginalSchedule(tableOnOriginalInstallment);
    loanTestHelper.makePayment(systemDateTime.plusDays(5), "100");
    //Then
    verifyOriginalSchedule(tableOnOriginalInstallment);
    applicationDatabaseOperation.updateLSIM(0);
}
Also used : ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) Calendar(java.util.Calendar) ArrayList(java.util.ArrayList) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters) DateTime(org.joda.time.DateTime) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) Test(org.testng.annotations.Test)

Aggregations

LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)130 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)50 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)37 Test (org.testng.annotations.Test)36 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)29 DateTime (org.joda.time.DateTime)28 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)20 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)16 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)15 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)14 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)10 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)10 ArrayList (java.util.ArrayList)9 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)9 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)9 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)9 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)8 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8