Search in sources :

Example 21 with CreateLoanAccountSubmitParameters

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

the class UpdateCustomPropertiesTest method verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts.

/*
     * 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-215
@Test(enabled = true)
public void verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts() throws Exception {
    //Given
    propertiesHelper.setSavingsPendingApprovalStateEnabled("true");
    propertiesHelper.setLoanPendingApprovalStateEnabled("true");
    propertiesHelper.setGroupPendingApprovalStateEnabled("true");
    //When
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("UpdateCustomProperties TestClient");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
    savingsAccountPage.verifyPage();
    //Then
    savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
    savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
    savingsAccountPage.verifyStatus("Application Pending Approval");
    //when
    CreateLoanAccountSearchParameters searchParameters2 = new CreateLoanAccountSearchParameters();
    searchParameters2.setSearchString("UpdateCustomProperties TestClient");
    searchParameters2.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountSubmitParameters submitAccountParameters2 = new CreateLoanAccountSubmitParameters();
    submitAccountParameters2.setAmount("2765.0");
    submitAccountParameters2.setGracePeriodTypeNone(true);
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters2, submitAccountParameters2);
    loanAccountPage.verifyStatus("Application Pending Approval");
}
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) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 22 with CreateLoanAccountSubmitParameters

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

the class ClientTest method addLoanToCustomer.

private LoanAccountPage addLoanToCustomer(String searchString, boolean active, String loanProduct, DateTime date) throws UnsupportedEncodingException {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    CreateLoanAccountSubmitParameters submitParameters = new CreateLoanAccountSubmitParameters();
    submitParameters.setAmount("1000");
    submitParameters.setDd(String.valueOf(date.getDayOfMonth()));
    submitParameters.setMm(String.valueOf(date.getMonthOfYear()));
    submitParameters.setYy(String.valueOf(date.getYear()));
    searchParameters.setLoanProduct(loanProduct);
    searchParameters.setSearchString(searchString);
    LoanAccountPage lap = loanTestHelper.createLoanAccount(searchParameters, submitParameters);
    if (active) {
        loanTestHelper.activateLoanAccount(lap.getAccountId());
        loanTestHelper.disburseLoan(date);
    }
    return lap;
}
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 23 with CreateLoanAccountSubmitParameters

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

the class HolidayTest method holidaysRepaymentRuleSameDayWithBatchJobs.

//http://mifosforge.jira.com/browse/MIFOSTEST-74
@Test(enabled = true)
public void holidaysRepaymentRuleSameDayWithBatchJobs() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2035, 1, 1, 13, 0, 0, 0));
    //When
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    LoanAccountPage page = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String lid = page.getAccountId();
    page.navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("12-Jan-2035", "19-Jan-2035", "26-Jan-2035", "02-Feb-2035", "09-Feb-2035", "16-Feb-2035", "23-Feb-2035", "02-Mar-2035", "09-Mar-2035", "16-Mar-2035");
    CreateHolidaySubmitParameters param = getHolidayParameters("2035");
    param.setRepaymentRule(CreateHolidaySubmitParameters.SAME_DAY);
    createHolidayForInstallments(param);
    //Then
    runBatchJobsForHoliday();
    navigationHelper.navigateToLoanAccountPage(lid).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("12-Jan-2035", "19-Jan-2035", "26-Jan-2035", "02-Feb-2035", "09-Feb-2035", "16-Feb-2035", "23-Feb-2035", "02-Mar-2035", "09-Mar-2035", "16-Mar-2035");
}
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) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 24 with CreateLoanAccountSubmitParameters

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

the class HolidayTest method holidaysRepaymentRuleNextWorkingDayWithBatchJobs.

//http://mifosforge.jira.com/browse/MIFOSTEST-76
@Test(enabled = true)
public void holidaysRepaymentRuleNextWorkingDayWithBatchJobs() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2036, 1, 1, 13, 0, 0, 0));
    //When
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    LoanAccountPage page = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String lid = page.getAccountId();
    page.navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("11-Jan-2036", "18-Jan-2036", "25-Jan-2036", "01-Feb-2036", "08-Feb-2036", "15-Feb-2036", "22-Feb-2036", "29-Feb-2036", "07-Mar-2036", "14-Mar-2036");
    CreateHolidaySubmitParameters param = getHolidayParameters("2036");
    param.setRepaymentRule(CreateHolidaySubmitParameters.NEXT_WORKING_DAY);
    createHolidayForInstallments(param);
    //Then
    runBatchJobsForHoliday();
    navigationHelper.navigateToLoanAccountPage(lid).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("11-Jan-2036", "18-Jan-2036", "25-Jan-2036", "01-Feb-2036", "08-Feb-2036", "29-Feb-2036", "29-Feb-2036", "29-Feb-2036", "07-Mar-2036", "14-Mar-2036");
}
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) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 25 with CreateLoanAccountSubmitParameters

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

the class HolidayTest method holidaysRepaymentRule.

/*
     * FIXME: KEITHW - disabling these holiday tests as when they create a loan, they are expecting to go to a 
     * 'nextPayment_loanAccount' page to see 'review of installments'??? 
     */
//http://mifosforge.jira.com/browse/MIFOSTEST-79
@Test(enabled = true)
public void holidaysRepaymentRule() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2031, 1, 1, 13, 0, 0, 0));
    //When
    createHolidayForInstallments(getHolidayParameters("2031"));
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    //Then
    loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("10-Jan-2031", "17-Jan-2031", "24-Jan-2031", "31-Jan-2031", "07-Feb-2031", "07-Mar-2031", "07-Mar-2031", "07-Mar-2031", "07-Mar-2031", "14-Mar-2031");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)39 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)36 Test (org.testng.annotations.Test)31 DateTime (org.joda.time.DateTime)18 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)14 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)9 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 EditLoanAccountInformationParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters)5 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)5 ArrayList (java.util.ArrayList)4 CreateHolidaySubmitParameters (org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)4 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)4 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)4 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)4 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)4 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)4 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)4 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)3 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)3 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)3