Search in sources :

Example 6 with DisburseLoanParameters

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

the class LoanProcessWithDifferentCurrencyTest method disburseLoan.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
private void disburseLoan(String loanAccountId) throws Exception {
    // account w/ id 000100000000029 has an approved but not disbursed loan.
    DisburseLoanParameters params = new DisburseLoanParameters();
    params.setDisbursalDateDD("17");
    params.setDisbursalDateMM("02");
    params.setDisbursalDateYYYY("2011");
    params.setPaymentType(DisburseLoanParameters.CASH);
    loanTestHelper.disburseLoan(loanAccountId, params);
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)

Example 7 with DisburseLoanParameters

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

the class CreateGroupLoanAccountTest method newWeeklyGroupLoanAccount.

//http://mifosforge.jira.com/browse/MIFOSTEST-303
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyGroupLoanAccount() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 25, 1, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    //When
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("groupWithoutLoan");
    formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
    createLoanAccountEntryPage.setAmount("3000.0");
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 2, 25, 15, 0, 0, 0));
    selectAdditionalFees();
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    verifyFirstInstallmentDateAndDisbursalDateOnReviewPage();
    verifyAdditionalFeesOnReviewPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    verifyFirstInstallmentDateAndDisbursalDateOnPreviewPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    String loanId = loanAccountPage.getAccountId();
    loanAccountPage.verifyLoanIsPendingApproval();
    loanAccountPage.verifyNumberOfInstallments("4");
    loanAccountPage.verifyDisbursalDate("25/02/2011");
    loanAccountPage.verifyPrincipalOriginal("3,000");
    loanAccountPage.verifyLoanTotalBalance("3,466");
    loanAccountPage.verifyFeesOriginal("410");
    loanAccountPage.verifyInterestOriginal("56");
    verifyFees();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "04-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "11-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "18-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "25-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "749.4");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100");
    viewRepaymentSchedulePage.navigateToLoanAccountPage();
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    editLoanAccountStatusParameters.setNote("test");
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
    disburseParameters.setDisbursalDateDD("25");
    disburseParameters.setDisbursalDateMM("02");
    disburseParameters.setDisbursalDateYYYY("2011");
    loanTestHelper.disburseLoan(loanId, disburseParameters);
}
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) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) DateTime(org.joda.time.DateTime) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) ClientsAndAccountsHomepage(org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 8 with DisburseLoanParameters

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

the class DecliningPrincipleLoanTest method createAndDisburseLoanAccount.

private LoanAccountPage createAndDisburseLoanAccount(int noOfInstallments, DateTime disbursalDate, String loanProductName) throws UnsupportedEncodingException {
    DisburseLoanParameters disburseLoanParameters = loanTestHelper.setDisbursalParams(disbursalDate);
    navigationHelper.navigateToHomePage();
    return loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(clientName, loanProductName).setDisbursalDate(disbursalDate).setInstallments(noOfInstallments).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage().navigateToEditAccountStatus().submitAndNavigateToNextPage(loanTestHelper.setApprovedStatusParameters()).submitAndNavigateToLoanAccountPage().navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseLoanParameters).submitAndNavigateToLoanAccountPage().navigateToApplyCharge().applyFeeAndConfirm(setCharge());
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)

Example 9 with DisburseLoanParameters

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

the class LoanAccountCycleTest method verifyAmountAndInstallmentsByCycles.

/**
     * Verify loan amount with number of installments by loan cycle can be used to create new loans.
     * http://mifosforge.jira.com/browse/MIFOSTEST-107
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountAndInstallmentsByCycles() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product107");
    productParams.setOfferingShortName("p107");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleLoanAmount = getAmountsByCycle();
    productParams.setCycleLoanAmount(cycleLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] calculateInstallments = getInstallmentsByCycle();
    productParams.setCycleInstallments(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product107");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
    loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(calculateInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "26", "52", "52" });
    loanAccountPage.disburseLoan(disburseParams);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "20", "30", "30" });
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 10 with DisburseLoanParameters

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

the class LoanAccountCycleTest method verifySecondLoanWithCycle.

/**
     * Verify redo Loan with cycle, when client has another Loan of the same product
     * http://mifosforge.jira.com/browse/MIFOSTEST-1184
     * 
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifySecondLoanWithCycle() throws Exception {
    loanTestHelper.setApplicationTime(new DateTime(2009, 02, 25, 0, 0, 0, 0)).navigateBack();
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product1184");
    productParams.setOfferingShortName("p1184");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleLoanAmount = getAmountsByCycle();
    productParams.setCycleLoanAmount(cycleLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] calculateInstallments = getInstallmentsByCycle();
    productParams.setCycleInstallments(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product1184");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    loanProductTestHelper.defineNewLoanProduct(productParams);
    loanTestHelper.setApplicationTime(new DateTime(2011, 02, 25, 0, 0, 0, 0)).navigateBack();
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "26", "52", "52" });
    loanAccountPage.disburseLoan(disburseParams);
    RedoLoanDisbursalParameters paramsPastDate = RedoLoanDisbursalParameters.createObjectWithClearedParameters();
    paramsPastDate.setDisbursalDateDD("18");
    paramsPastDate.setDisbursalDateMM("02");
    paramsPastDate.setDisbursalDateYYYY("2010");
    paramsPastDate.setLoanAmount("3000");
    paramsPastDate.setInterestRate("22");
    paramsPastDate.setNumberOfInstallments("20");
    loanTestHelper.redoLoanDisbursalWithoutNavigate("Stu1233171716380 Client1233171716380", "product1184", paramsPastDate).verifySecondLoanWithCycleError();
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) RedoLoanDisbursalParameters(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime)

Aggregations

DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)40 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)29 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)26 DateTime (org.joda.time.DateTime)15 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)14 Test (org.testng.annotations.Test)14 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)13 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)11 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)10 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)7 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)6 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)5 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)4 HashMap (java.util.HashMap)3 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)3 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)3 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)3 ArrayList (java.util.ArrayList)2