Search in sources :

Example 86 with CreateLoanAccountSearchParameters

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

the class SavingsPaymentTest method testPermissionForPaymentFromSavings.

public void testPermissionForPaymentFromSavings() {
    String loanGlobalNum = setUpLoanAccount();
    String savingsGlobalNum = setUpSavingsAccount();
    String errorMessage = "You do not have permission to make payment to the account using Savings Account Transfer";
    //first uncheck permission and see if access denied page is displayed
    //while trying transfer from savings
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    if (manageRolePage.isPermissionEnable("5_1_11")) {
        manageRolePage.disablePermission("5_1_11");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
    loanSearchParams.setSearchString(loanGlobalNum);
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanGlobalNum);
    ApplyPaymentPage applyPaymentPage = loanAccountPage.navigateToApplyPayment();
    PaymentParameters paymentParams = new PaymentParameters();
    paymentParams.setAmount(String.valueOf(TRANSFER_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");
    try {
        applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParams);
    } catch (AssertionError e) {
        Assert.assertTrue(selenium.isTextPresent(errorMessage));
    }
    //now enable permission and validate transfer success
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    if (!manageRolePage.isPermissionEnable("5_1_11")) {
        manageRolePage.enablePermission("5_1_11");
    }
    manageRolePage.submitAndGotoViewRolesPage();
    navigationHelper.navigateToLoanAccountPage(loanGlobalNum).navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(paymentParams).submitAndNavigateToLoanAccountDetailsPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 87 with CreateLoanAccountSearchParameters

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

the class VariableInstalmentLoanTest method setLoanSearchParameters.

private CreateLoanAccountSearchParameters setLoanSearchParameters() {
    CreateLoanAccountSearchParameters accountSearchParameters = new CreateLoanAccountSearchParameters();
    accountSearchParameters.setSearchString(clientName);
    accountSearchParameters.setLoanProduct(loanProductName);
    return accountSearchParameters;
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)

Example 88 with CreateLoanAccountSearchParameters

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

the class NoDBUnitAdditionalHolidayTest method createMonthlyLoan.

private LoanAccountPage createMonthlyLoan(final String year) {
    // create a loan that has its repayment on the 1st of every month
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1234.0");
    submitAccountParameters.setDd("01");
    submitAccountParameters.setMm("03");
    submitAccountParameters.setYy(year);
    LoanAccountPage page = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    return page;
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 89 with CreateLoanAccountSearchParameters

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

the class ClientLoanDisbursalTest method verifyAcceptedPaymentTypesForDisbursementsOfLoan.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-249
void verifyAcceptedPaymentTypesForDisbursementsOfLoan() throws Exception, InterruptedException {
    // When
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    searchParams.setSearchString("Stu1233266063395 Client1233266063395");
    //Extension https://mifosforge.jira.com/browse/MIFOSTEST-1194
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
    DisburseLoanPage disburseLoanPage = loanAccountPage.navigateToDisburseLoan();
    DisburseLoanParameters params = new DisburseLoanParameters();
    params.setDisbursalDateDD("20");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    params.setPaymentType(params.CASH);
    disburseLoanPage.verifyDisbursalDateIsFutureDate(params);
    //disburseLoanPage.submitWithWrongParams(params, "Date of transaction can not be a future date");
    params.setDisbursalDateDD("01");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    disburseLoanPage.verifyDisbursalDateIsPriorToClientMeetingSchedule(params);
    params.setDisbursalDateDD("04");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    //Then
    disburseLoanPage.verifyModeOfPayments();
    disburseLoanPage.submitAndNavigateToDisburseLoanConfirmationPage(params).submitAndNavigateToLoanAccountPage();
    String[] locators = { "Payment rcvd.", "accountActivityTable.2.1" };
    loanAccountPage.navigateToViewLoanAccountActivityPage().verifyAllElementsArePresent(locators);
    //When
    disburseLoanPage = navigationHelper.navigateToLoanAccountPage("000100000000020").navigateToDisburseLoan();
    //Then
    disburseLoanPage.verifyModeOfPayments();
    disburseLoanPage.verifyPaymentModesOfPaymentAreEmpty();
    disburseLoanPage.verifyPaymentModeOfPaymentIsEditable("payment mode of payment must be editable when a disbursal fee exists.");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DisburseLoanPage(org.mifos.test.acceptance.framework.loan.DisburseLoanPage) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)

Example 90 with CreateLoanAccountSearchParameters

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

the class LoanAccountCycleTest method verifyAmountByCycleAndInstallmentsByLastAmount.

/**
     * Verify loan amount with number of installments by last loan amount can be used to create new loans.
     * http://mifosforge.jira.com/browse/MIFOSTEST-110
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountByCycleAndInstallmentsByLastAmount() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setOfferingName("product110");
    productParams.setOfferingShortName("p110");
    productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
    String[][] cycleLoanAmount = getAmountsByCycle();
    productParams.setCycleLoanAmount(cycleLoanAmount);
    productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
    String[][] calculateInstallments = getInstallmentsFromLastAmount();
    productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233171716380 Client1233171716380");
    searchParams.setLoanProduct("product110");
    DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
    LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
    loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
    loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
    LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "5", "10", "5" });
    String loanFirstID = loanAccountPage.getAccountId();
    loanAccountPage.disburseLoan(disburseParams);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "5", "10", "5" });
    loanTestHelper.repayLoan(loanFirstID);
    loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "10", "30", "25" });
}
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)

Aggregations

CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)95 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)50 Test (org.testng.annotations.Test)46 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)36 DateTime (org.joda.time.DateTime)35 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)26 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)22 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)19 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)19 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)13 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)12 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)12 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)11 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)11 ArrayList (java.util.ArrayList)9 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)8 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)7