Search in sources :

Example 36 with LoanAccountPage

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

the class FeeTest method canApplyOneTimeFeeAfterPaymentsHaveBeenMade.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void canApplyOneTimeFeeAfterPaymentsHaveBeenMade() throws Exception {
    String client = "WeeklyClient Monday";
    DateTime currentTime = new DateTime().withYear(2012).withDayOfMonth(3).withMonthOfYear(12);
    new DateTimeUpdaterRemoteTestingService(selenium).setDateTime(currentTime);
    String dd = Integer.toString(currentTime.getDayOfMonth());
    String mm = Integer.toString(currentTime.getMonthOfYear());
    String yy = Integer.toString(currentTime.getYear());
    applicationDatabaseOperation.updateLSIM(1);
    LoanAccountPage loanAccountPage = loanTestHelper.createActivateDisburstAndApplyPaymentForDefaultLoanAccount(client, dd, mm, yy);
    double feesBefore = Double.parseDouble(loanAccountPage.getFeesBalance());
    loanAccountPage = loanTestHelper.applyCharge("Misc Fees", "1");
    double feesAfter = Double.parseDouble(loanAccountPage.getFeesBalance());
    Assert.assertEquals(feesBefore + 1.0, feesAfter);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 37 with LoanAccountPage

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

the class CreateGLIMLoanAccountTest method checkGLIMIndividualSchedule.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMIndividualSchedule() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999", "0012-Sheep Purchase");
    loanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999");
    loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999");
    LoanAccountPage loanAccountPage = loanAccountEntryPage.navigateToReviewInstallmentsPage().clickPreviewAndGoToReviewLoanAccountPage().submitForApprovalAndNavigateToConfirmationPage().navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    EditLoanAccountStatusParameters statusParams = new EditLoanAccountStatusParameters();
    statusParams.setNote("GLIM test");
    statusParams.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage.changeAccountStatus(statusParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    String loanId = loanAccountPage.getAccountId();
    dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
    loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setAmount("209997.0");
    disburseParams.setDisbursalDateDD("8");
    disburseParams.setDisbursalDateMM("3");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage.disburseLoan(disburseParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    PaymentParameters paymentParams = new PaymentParameters();
    paymentParams.setAmount("1500.0");
    paymentParams.setTransactionDateDD("8");
    paymentParams.setTransactionDateMM("3");
    paymentParams.setTransactionDateYYYY("2011");
    paymentParams.setPaymentType(PaymentParameters.CASH);
    loanTestHelper.applyPayment(loanId, paymentParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmit("1500.0");
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    String[] expectedPrincipalAmounts = new String[] { "24.9", "249.2", "249.3" };
    String[] expectedInterestAmounts = new String[] { "46", "460.3", "460.3" };
    String[] expectedFeeAmounts = new String[] { "0.5", "4.8", "4.7" };
    verifyProRatedGLIMPayments(loanAccountPage, 3, expectedPrincipalAmounts, expectedInterestAmounts, expectedFeeAmounts);
    loanTestHelper.repayLoan(loanId);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    loanAccountPage.navigateToApplyAdjustment().submitAdjustment();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    statusParams.setNote("GLIM test");
    statusParams.setStatus(EditLoanAccountStatusParameters.CLOSED_WRITTEN_OFF);
    loanAccountPage.changeAccountStatus(statusParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 38 with LoanAccountPage

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

the class CreateGroupLoanAccountTest method CreateLoanWithGLIMandLSIMenabled.

/**
    * Create a new Group Loan with GLIM and LSIM enabled
    * http://mifosforge.jira.com/browse/MIFOSTEST-1179
    *
    * @throws Exception
    */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void CreateLoanWithGLIMandLSIMenabled() throws Exception {
    applicationDatabaseOperation.updateGLIM(1);
    applicationDatabaseOperation.updateLSIM(1);
    setAppDate(new DateTime(2011, 4, 29, 15, 0, 0, 0));
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("Default Group");
    formParameters.setLoanProduct("GroupEmergencyLoan");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
    verifyDisbursalDateOnLoanEntryPage();
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 4, 30, 15, 0, 0, 0));
    verifyDisbursalDateErrorMessage();
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 4, 21, 15, 0, 0, 0));
    verifyDisbursalDateErrorMessage();
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 4, 29, 15, 0, 0, 0));
    createLoanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "500", "0000-Animal Husbandry");
    createLoanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "1000", "0001-Cow Purchase");
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    verifyFirstInstallmentAndDisbursalDateOnReviewPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    verifyFirstInstallmentAndDisbursalDateOnPreviewPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyLoanIsPendingApproval();
    loanAccountPage.verifyNumberOfInstallments("10");
    loanAccountPage.verifyDisbursalDate("29/04/2011");
    loanAccountPage.verifyPrincipalOriginal("1,500");
    loanAccountPage.verifyLoanTotalBalance("1,500");
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "06-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "13-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "20-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "27-May-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(7, "03-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(8, "10-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(9, "17-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(10, "24-Jun-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(11, "01-Jul-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(12, "08-Jul-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(7, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(8, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(9, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(10, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(11, "150");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(12, "150");
    viewRepaymentSchedulePage.navigateToLoanAccountPage();
    applicationDatabaseOperation.updateGLIM(0);
    applicationDatabaseOperation.updateLSIM(0);
}
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 39 with LoanAccountPage

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

the class GuarantyCoreTest method createAndDisburseGroupLoan.

public void createAndDisburseGroupLoan() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 04, 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", "1000", null));
    glimClients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "100", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    String loanId = loanAccountPage.getAccountId();
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test apply Guaranty");
    loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("09");
    disburseParams.setDisbursalDateMM("04");
    disburseParams.setDisbursalDateYYYY("2013");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    verifyGuarantyGroupIndividualLoan(loanAccountPage);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 40 with LoanAccountPage

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

the class NoDBUnitAdditionalHolidayTest method createHolidayOnAMeetingWithRepaymentSameDay.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
/*
     * loan creation for setup is stepping into questionnaire page when it shouldnt
     */
@Test(enabled = true)
public void createHolidayOnAMeetingWithRepaymentSameDay() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2041, 1, 1, 13, 0, 0, 0));
    // create loan paid on the 1st of every month and then create a holiday on 1st July
    LoanAccountPage page = createMonthlyLoan("2041");
    String loanId = page.getAccountId();
    page.navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("01-Apr-2041", "01-May-2041", "01-Jun-2041", "01-Jul-2041", "01-Aug-2041", "02-Sep-2041", "01-Oct-2041", "01-Nov-2041", "02-Dec-2041", "01-Jan-2042");
    // create a holiday on 1st of july
    createHolidayOn1stJuly(CreateHolidayEntryPage.CreateHolidaySubmitParameters.SAME_DAY, "2041");
    runHolidayBatchJob();
    navigationHelper.navigateToLoanAccountPage(loanId).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("01-Apr-2041", "01-May-2041", "01-Jun-2041", "01-Jul-2041", "01-Aug-2041", "02-Sep-2041", "01-Oct-2041", "01-Nov-2041", "02-Dec-2041", "01-Jan-2042");
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Aggregations

LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)130 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)50 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)37 Test (org.testng.annotations.Test)36 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)29 DateTime (org.joda.time.DateTime)28 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)20 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)16 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)15 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)14 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)10 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)10 ArrayList (java.util.ArrayList)9 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)9 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)9 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)9 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)8 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8