Search in sources :

Example 31 with CreateLoanAccountSearchParameters

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

the class HolidayTest method holidaysRepaymentRuleNextWorkingDay.

//http://mifosforge.jira.com/browse/MIFOSTEST-81
@Test(enabled = true)
public void holidaysRepaymentRuleNextWorkingDay() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2033, 1, 1, 13, 0, 0, 0));
    //When
    CreateHolidaySubmitParameters param = getHolidayParameters("2033");
    param.setRepaymentRule(CreateHolidaySubmitParameters.NEXT_WORKING_DAY);
    createHolidayForInstallments(param);
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    //Then
    loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("14-Jan-2033", "21-Jan-2033", "28-Jan-2033", "04-Feb-2033", "11-Feb-2033", "01-Mar-2033", "01-Mar-2033", "04-Mar-2033", "11-Mar-2033", "18-Mar-2033");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 32 with CreateLoanAccountSearchParameters

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

the class HolidayTest method holidaysRepaymentRuleSameDay.

//http://mifosforge.jira.com/browse/MIFOSTEST-78
@Test(enabled = true)
public void holidaysRepaymentRuleSameDay() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2032, 1, 1, 13, 0, 0, 0));
    //When
    CreateHolidaySubmitParameters param = getHolidayParameters("2032");
    param.setRepaymentRule(CreateHolidaySubmitParameters.SAME_DAY);
    createHolidayForInstallments(param);
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    //Then
    loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("09-Jan-2032", "16-Jan-2032", "23-Jan-2032", "30-Jan-2032", "06-Feb-2032", "13-Feb-2032", "20-Feb-2032", "27-Feb-2032", "05-Mar-2032", "12-Mar-2032");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 33 with CreateLoanAccountSearchParameters

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

the class ClientTest method removeClientWithLoanFromGroup.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOS-5843
@Test(enabled = true)
public void removeClientWithLoanFromGroup() throws Exception {
    // Given
    String clientName = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT").getHeading();
    clientTestHelper.activateClient(clientName);
    // Then
    clientTestHelper.addClientToGroup(clientName, "groupWithoutLoan");
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString(clientName);
    searchParams.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    CreateLoanAccountSubmitParameters submitLoanAccountParameters = new CreateLoanAccountSubmitParameters();
    submitLoanAccountParameters.setDd("22");
    submitLoanAccountParameters.setMm("01");
    submitLoanAccountParameters.setYy("2010");
    String loanAccounntID = loanTestHelper.createLoanAccount(searchParams, submitLoanAccountParameters).getAccountId();
    loanTestHelper.activateLoanAccount(loanAccounntID);
    String groupName = navigationHelper.navigateToClientViewDetailsPage(clientName).getGroupMembership();
    SavingsProductParameters params = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2009, 7, 13, 12, 0, 0, 0), SavingsProductParameters.MANDATORY, SavingsProductParameters.GROUPS);
    savingsProductHelper.createSavingsProduct(params);
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString(groupName);
    searchParameters.setSavingsProduct(params.getProductInstanceName());
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("250.0");
    String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("change status to active");
    savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
    // When / Then
    clientTestHelper.deleteClientGroupMembership(clientName, "remove group membership");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTime(org.joda.time.DateTime) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 34 with CreateLoanAccountSearchParameters

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

the class ClientTest method verifyCustomerScheduleAfterMovingClientToGroupWithDifferentMeetingFrequency.

public void verifyCustomerScheduleAfterMovingClientToGroupWithDifferentMeetingFrequency() {
    //Given
    String startGroupName = "GroupWeekly";
    String destinationGroupName = "MonthlyGroup";
    String clientName = "DoeTest2";
    //define declining balance monthly loan product
    DefineNewLoanProductPage.SubmitFormParameters formParameters = FormParametersHelper.getMonthlyLoanProductParameters();
    navigationHelper.navigateToAdminPage().defineLoanProduct(formParameters);
    //client
    CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
    clientParams.setFirstName("John");
    clientParams.setLastName(clientName);
    ClientViewDetailsPage clientPage = clientTestHelper.createNewClient(startGroupName, clientParams);
    clientTestHelper.changeCustomerStatus(clientPage, ClientStatus.ACTIVE);
    //When
    CreateLoanAccountSearchParameters loanFormParameters = new CreateLoanAccountSearchParameters();
    loanFormParameters.setSearchString(clientName);
    loanFormParameters.setLoanProduct("productMonthly*");
    clientPage.navigateToEditRemoveGroupMembership().searchGroup(destinationGroupName).selectGroupToAdd(destinationGroupName).submitAddGroup().navigateToClientsAndAccountsPageUsingHeaderTab().navigateToCreateLoanAccountUsingLeftMenu().searchAndNavigateToCreateLoanAccountPage(loanFormParameters);
    //Then
    //get current month
    int currentMonth = targetTime.getMonthOfYear();
    //get disbursement month
    int disbursementMonth = Integer.parseInt(selenium.getValue("id=disbursementDateMM"));
    //check if its a last month
    if (currentMonth == 12) {
        currentMonth = 1;
    } else {
        currentMonth++;
    }
    Assert.assertEquals(currentMonth, disbursementMonth);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)

Example 35 with CreateLoanAccountSearchParameters

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

the class UpdateCustomPropertiesTest method verifyPropertyGroupCanApplyLoansTrue.

/*
     * FIXME - keithw - test passes when run individually but not as part of ci build. it appears that question groups data is not
     *                  cleaned up right as instead of stepping to review installments, the questionnaire page is presented.
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//http://mifosforge.jira.com/browse/MIFOSTEST-234
@Test(enabled = true)
public void verifyPropertyGroupCanApplyLoansTrue() throws Exception {
    //Given
    propertiesHelper.setGroupCanApplyLoans("true");
    LoanTestHelper helper = new LoanTestHelper(selenium);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("UpdateCustomPropertiesTestGroup");
    searchParameters.setLoanProduct("GroupEmergencyLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("2000.0");
    //When Then
    helper.createLoanAccount(searchParameters, submitAccountParameters);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) Test(org.testng.annotations.Test)

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