Search in sources :

Example 1 with EditLoanAccountInformationParameters

use of org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters 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)

Example 2 with EditLoanAccountInformationParameters

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

the class EditLoanAccountTest method editExternalIdOfLSIMLoan.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void editExternalIdOfLSIMLoan() throws Exception {
    String testAccount = "000100000000012";
    EditLoanAccountInformationParameters params = new EditLoanAccountInformationParameters();
    params.setExternalID("ID83328");
    editLoanAccount(testAccount, params);
    assertTextFoundOnPage(params.getExternalID());
}
Also used : EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters)

Example 3 with EditLoanAccountInformationParameters

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

the class ModifyingGroupLoanTest method editAccountInfoTest.

public void editAccountInfoTest() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 9, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
    glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null));
    glimClients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "37", null));
    glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    editLoanAccountInformationPage.setInterestRate("33");
    editLoanAccountInformationPage.setNumberOfInstallments("8");
    EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
    editAccountParameters.setCollateralNotes("Test Edit new GLIM Loan");
    editAccountParameters.setExternalID("1234");
    editLoanAccountInformationPage.editAccountParams(new CreateLoanAccountSubmitParameters(), editAccountParameters);
    loanAccountPage = editLoanAccountInformationPage.submitAndNavigateToAccountInformationPreviewPage().submitAndNavigateToLoanAccountPage();
    verifyEditedAccountParameters(loanAccountPage);
    verifyModifiedAccountParametersFromIndividualMemberAccount(loanAccountPage);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 4 with EditLoanAccountInformationParameters

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

the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithModifyErrors.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// add grace period of 10 to "Flat Interest Loan Product With Fee"
@Test(enabled = true)
public void newWeeklyClientLoanAccountWithModifyErrors() throws Exception {
    setAppDate(new DateTime(2011, 3, 7, 15, 0, 0, 0));
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("client1 lastname");
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    String loanId = createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
    submitAccountParameters.setAmount("10666.0");
    EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
    editAccountParameters.setGracePeriod("15");
    EditLoanAccountInformationPage editPreviewLoanAccountPage = loanTestHelper.changeLoanAccountInformationWithErrors(loanId, submitAccountParameters, editAccountParameters);
    editPreviewLoanAccountPage.verifyErrorInForm("Please specify valid Amount. Amount should be a value between 1 and 10,000, inclusive");
    editPreviewLoanAccountPage.verifyErrorInForm("Please specify valid Grace period for repayments. Grace period for repayments should be a value less than 12");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 5 with EditLoanAccountInformationParameters

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

the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithDateTypeCustomField.

@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithDateTypeCustomField() throws Exception {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("client1 lastname");
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    String loanId = createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
    submitAccountParameters.setAmount("1666.0");
    EditLoanAccountInformationParameters editAccountParameters = new EditLoanAccountInformationParameters();
    editAccountParameters.setGracePeriod("5");
    loanTestHelper.changeLoanAccountInformation(loanId, submitAccountParameters, editAccountParameters);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) EditLoanAccountInformationParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters) Test(org.testng.annotations.Test)

Aggregations

EditLoanAccountInformationParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters)6 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)5 DateTime (org.joda.time.DateTime)4 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 Test (org.testng.annotations.Test)4 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)3 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)3 ArrayList (java.util.ArrayList)2 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)2 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)2 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)2 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)2 Calendar (java.util.Calendar)1 LocalDate (org.joda.time.LocalDate)1 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)1 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)1 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)1 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)1