Search in sources :

Example 1 with EditLoanAccountStatusParameters

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

the class LoanTestHelper method activateLoanAccount.

public void activateLoanAccount(String loanId) {
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(AccountStatus.LOAN_APPROVED.getStatusText());
    editLoanAccountStatusParameters.setNote("Activate account");
    changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)

Example 2 with EditLoanAccountStatusParameters

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

the class ApplyAdjustmentGroupLoanTest method adjustmentWithCommaTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void adjustmentWithCommaTest() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    loanAccountEntryPage.setDisbursalDate(new DateTime(2013, 2, 8, 15, 0, 0, 0));
    loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null);
    loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null);
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    String loanId = loanAccountPage.getAccountId();
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test new GLIM");
    loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
    DisburseLoanParameters params = new DisburseLoanParameters();
    params.setPaymentType(DisburseLoanParameters.CASH);
    loanTestHelper.disburseLoan(loanId, params);
    PaymentParameters paymentParameters = new PaymentParameters();
    paymentParameters.setAmount("2500.0");
    paymentParameters.setPaymentType(PaymentParameters.CASH);
    paymentParameters.setTransactionDateDD("08");
    paymentParameters.setTransactionDateMM("2");
    paymentParameters.setTransactionDateYYYY("2013");
    loanTestHelper.applyGroupPayment(loanId, paymentParameters);
    loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmitGroupLoan("2500.0");
    Assert.assertFalse(selenium.isTextPresent("stack trace"));
    Assert.assertTrue(selenium.isTextPresent("2,500"));
}
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) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 3 with EditLoanAccountStatusParameters

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

the class CreateGroupLoanAccountTest method newWeeklyGroupLoanAccount.

//http://mifosforge.jira.com/browse/MIFOSTEST-303
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyGroupLoanAccount() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 25, 1, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    //When
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
    CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
    formParameters.setSearchString("groupWithoutLoan");
    formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
    createLoanAccountEntryPage.setAmount("3000.0");
    createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 2, 25, 15, 0, 0, 0));
    selectAdditionalFees();
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
    verifyFirstInstallmentDateAndDisbursalDateOnReviewPage();
    verifyAdditionalFeesOnReviewPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    verifyFirstInstallmentDateAndDisbursalDateOnPreviewPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    String loanId = loanAccountPage.getAccountId();
    loanAccountPage.verifyLoanIsPendingApproval();
    loanAccountPage.verifyNumberOfInstallments("4");
    loanAccountPage.verifyDisbursalDate("25/02/2011");
    loanAccountPage.verifyPrincipalOriginal("3,000");
    loanAccountPage.verifyLoanTotalBalance("3,466");
    loanAccountPage.verifyFeesOriginal("410");
    loanAccountPage.verifyInterestOriginal("56");
    verifyFees();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "04-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "11-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "18-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "25-Mar-2011");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "750.2");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "749.4");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100");
    viewRepaymentSchedulePage.navigateToLoanAccountPage();
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    editLoanAccountStatusParameters.setNote("test");
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
    disburseParameters.setDisbursalDateDD("25");
    disburseParameters.setDisbursalDateMM("02");
    disburseParameters.setDisbursalDateYYYY("2011");
    loanTestHelper.disburseLoan(loanId, disburseParameters);
}
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) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountSearchPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage) DateTime(org.joda.time.DateTime) 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) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)

Example 4 with EditLoanAccountStatusParameters

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

the class CreateClientLoanAccountTest method getLoanStatusActive.

private void getLoanStatusActive(String loanId) {
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    editLoanAccountStatusParameters.setNote("test");
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
    disburseParameters.setDisbursalDateDD("01");
    disburseParameters.setDisbursalDateMM("02");
    disburseParameters.setDisbursalDateYYYY("2011");
    //Then
    loanTestHelper.disburseLoan(loanId, disburseParameters);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)

Example 5 with EditLoanAccountStatusParameters

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

Aggregations

EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)18 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)11 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)8 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)8 Test (org.testng.annotations.Test)7 DateTime (org.joda.time.DateTime)5 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)4 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)3 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)3 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)3 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)3 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)3 LocalDate (org.joda.time.LocalDate)2 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)2 AccountChangeStatusPage (org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage)2 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)2 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)2 ArrayList (java.util.ArrayList)1