Search in sources :

Example 71 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method approveLoanAmountByDifferentLoanAmountRangesTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOSTEST-1185
@Test(enabled = true)
public void approveLoanAmountByDifferentLoanAmountRangesTest() throws Exception {
    // When
    ManageRolePage manageRolePage = new ManageRolePage(selenium);
    //.
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "asdf");
    manageRolePage.verifyAmountTextField();
    manageRolePage.typeText("restrictionValue(1)", "5,000");
    manageRolePage.enablePermission("activityRestrictionCheckbox1");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    searchParameters.setSearchString("ClientWithLoan 20110221");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("6000");
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String loanAccountId = loanAccountPage.getAccountId();
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    editAccountStatusParameters.setNote("Approve test");
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters);
    loanAccountPage.verifyLoanAmountPermissionError();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PARTIAL);
    searchParameters.setSearchString(loanAccountId);
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    //When
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("activityRestrictionCheckbox1");
    manageRolePage.typeText("restrictionValue(1)", "");
    manageRolePage.submitAndGotoViewRolesPage();
    //Then
    loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PENDING_APPROVAL);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
    editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
    loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 72 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method createLoanInPartialApplicationStatus.

/**
    * Create a new Client Loan in 'Partial Application' status
    * http://mifosforge.jira.com/browse/MIFOSTEST-1177
    *
    * @throws Exception
    */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createLoanInPartialApplicationStatus() throws Exception {
    setAppDate(new DateTime(2011, 4, 27, 15, 0, 0, 0));
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("Client1233266063395");
    formParameters.setLoanProduct("ClientEmergencyLoan");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    verifyFirstInstallmentAndDisbursalDateOnReviewPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    verifyFirstInstallmentAndDisbursalDateOnPreviewPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForLaterAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyLoanIsInPartialApplication();
    loanAccountPage.verifyNumberOfInstallments("10");
    loanAccountPage.verifyDisbursalDate("02/05/2011");
    loanAccountPage.verifyPrincipalOriginal("1,000");
    loanAccountPage.verifyLoanTotalBalance("1,000");
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "09-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "16-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "23-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "30-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(7, "06-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(8, "13-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(9, "20-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(10, "27-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(11, "04-Jul-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(12, "11-Jul-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(7, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(8, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(9, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(10, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(11, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(12, "100");
    viewRepaymentSchedulePage.navigateToLoanAccountPage();
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) 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) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 73 with CreateLoanAccountSearchParameters

use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters 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 74 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//http://mifosforge.jira.com/browse/MIFOSTEST-308
@Test(enabled = true)
public void newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1234.0");
    submitAccountParameters.setGracePeriodTypeNone(true);
    //Then
    String loanId = createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
    getLoanStatusActive(loanId);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 75 with CreateLoanAccountSearchParameters

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

the class CreateClientLoanAccountTest method newLoanAccountWithThousandSeparator.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void newLoanAccountWithThousandSeparator() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly");
    searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1,234.0");
    submitAccountParameters.setGracePeriodTypeNone(true);
    //Then
    createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) 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