Search in sources :

Example 16 with ViewRepaymentSchedulePage

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

the class MpesaImportTest method importTheSameFiles.

/**
     * MPESA - Import has errors and user chooses to import
     * a different file with some valid and invalid data.
     * http://mifosforge.jira.com/browse/MIFOSTEST-695
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void importTheSameFiles() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    //When
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
    //Then
    importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    loanAccountPage.verifyPerformanceHistory("11", "11");
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
    //When
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage = importTransactionsPage.failImportTransaction(path, EXCEL_IMPORT_TYPE);
    //Then
    importTransactionsPage.checkErrors(new String[] { "Same file has been already imported. Please import a different file." });
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 17 with ViewRepaymentSchedulePage

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

the class ApplyPaymentOnGLIMLoanAccountTest method checkApplyPaymentOnGLIMLoanAccount.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkApplyPaymentOnGLIMLoanAccount() throws Exception {
    LoanAccountPage loanAccountPage = createNewLoan();
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
    params.setNote("asd");
    params.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("04");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    ApplyGroupPaymentPage applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setAmount("140");
    applyGroupPaymentPage.verifyIndividualAmount(0, "20.0");
    applyGroupPaymentPage.verifyIndividualAmount(1, "40.0");
    applyGroupPaymentPage.verifyIndividualAmount(2, "80.0");
    //principal 25, less
    applyGroupPaymentPage.setIndividualAmount(0, "20");
    //principal 50, equal
    applyGroupPaymentPage.setIndividualAmount(1, "50");
    //principal 100, more
    applyGroupPaymentPage.setIndividualAmount(2, "120");
    applyGroupPaymentPage.verifyAmount("190");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setDate("04", "03", "2011");
    ApplyGroupPaymentConfirmationPage applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, EXPECTED_PAID_INSTALLMENTS);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    for (int i = 0; i <= 2; i += 1) {
        viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualRepaymentSchedulePage(i);
        verifyRepaymentScheduleInstallmentsPaid(viewRepaymentSchedulePage, INDIVIDUAL_EXPECTED_PAID_INSTALLMENTS[i]);
        loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    }
    // Test applying payment for last installment
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentPage.setAmount("1500");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    // Last installment left to payoff whole account
    applyGroupPaymentPage = loanAccountPage.navigateToApplyGroupPayment();
    applyGroupPaymentPage.verifyAmount("60.0");
    applyGroupPaymentPage.verifyIndividualAmount(0, "15.7");
    applyGroupPaymentPage.verifyIndividualAmount(1, "21.4");
    applyGroupPaymentPage.verifyIndividualAmount(2, "22.9");
    applyGroupPaymentPage.setPaymentMethod("1");
    applyGroupPaymentConfirmation = applyGroupPaymentPage.submit();
    loanAccountPage = applyGroupPaymentConfirmation.submitAndNavigateToLoanAccountDetailsPage();
    loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ApplyGroupPaymentConfirmationPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ApplyGroupPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyGroupPaymentPage) Test(org.testng.annotations.Test)

Example 18 with ViewRepaymentSchedulePage

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

the class CreateGLIMLoanAccountWithOneTimeFeeTest method checkGLIMLoanWithThreeClientsCreeatedCorrectly.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMLoanWithThreeClientsCreeatedCorrectly() throws Exception {
    LoanAccountPage loanAccountPage = createLoan();
    loanAccountPage.verifyLoanIsPendingApproval();
    loanAccountPage.verifyNumberOfInstallments("10");
    loanAccountPage.verifyDisbursalDate("04/03/2011");
    loanAccountPage.verifyPrincipalOriginal("1,000");
    loanAccountPage.verifyLoanTotalBalance("1,043");
    loanAccountPage.verifyFeesOriginal("1");
    loanAccountPage.verifyInterestOriginal("42");
    Assert.assertTrue(selenium.isTextPresent("oneTimeFee: 1"));
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS, EXPECTED_INTERESTS, EXPECTED_FEES, EXPECTED_TOTALS);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    AccountChangeStatusPage accountChangeStatusPage = loanAccountPage.navigateToEditAccountStatus();
    EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
    params.setNote("asd");
    params.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage = accountChangeStatusPage.submitAndNavigateToNextPage(params).submitAndNavigateToLoanAccountPage();
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("04");
    disburseParams.setDisbursalDateMM("03");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(0).navigateToRepaymentSchedulePage();
    verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT1, EXPECTED_INTERESTS_CLIENT1, EXPECTED_FEES_CLIENT1, EXPECTED_TOTALS_CLIENT1);
    loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
    viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(1).navigateToRepaymentSchedulePage();
    verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT2, EXPECTED_INTERESTS_CLIENT2, EXPECTED_FEES_CLIENT2, EXPECTED_TOTALS_CLIENT2);
    loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
    viewRepaymentSchedulePage = loanAccountPage.navigateToIndividualLoanAccountPage(2).navigateToRepaymentSchedulePage();
    verifyRepaymentSchedule(viewRepaymentSchedulePage, 10, EXPECTED_PRINCIPALS_CLIENT3, EXPECTED_INTERESTS_CLIENT3, EXPECTED_FEES_CLIENT3, EXPECTED_TOTALS_CLIENT3);
    loanAccountPage = navigateBackToGroupLoanPageFromIndividualRepamentSchedule();
    loanAccountPage = clientRepayLoan(loanAccountPage, 0);
    loanAccountPage = clientRepayLoan(loanAccountPage, 1);
    loanAccountPage = clientRepayLoan(loanAccountPage, 2);
    loanAccountPage.verifyLoanStatus(LoanAccountPage.CLOSED);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) AccountChangeStatusPage(org.mifos.test.acceptance.framework.loan.AccountChangeStatusPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) Test(org.testng.annotations.Test)

Example 19 with ViewRepaymentSchedulePage

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

the class CashFlowTest method verifyCashFlowPageInLoanAccountCreationFlow.

/**
     * Disabled after work on daily interest calculation for variable installments. - keithw-
     * 
     * Verify Cash Flow Page in Loan Account creation flow	
     * http://mifosforge.jira.com/browse/MIFOSTEST-672
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyCashFlowPageInLoanAccountCreationFlow() throws Exception {
    applicationDatabaseOperation.updateLSIM(1);
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    productParams.setDefInstallments("12");
    productParams.setDefaultLoanAmount("2000");
    CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
    loanSearchParams.setSearchString(clientName);
    loanSearchParams.setLoanProduct(productParams.getOfferingName());
    DateTime disbursalDate = systemDateTime.plusDays(1);
    loanProductTestHelper.navigateToDefineNewLoanPageAndFillMandatoryFields(productParams).fillCashFlow("", "49", "400").fillVariableInstalmentOption("", "1", "").submitAndGotoNewLoanProductPreviewPage().submit();
    CreateLoanAccountCashFlowPage cashFlowPage = loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
    cashFlowPage.verifyTableExist();
    cashFlowPage.validateCashFlowMonths(disbursalDate, 12, DefineNewLoanProductPage.SubmitFormParameters.WEEKS);
    cashFlowPage.cancel();
    loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
    cashFlowPage.submitWithErrors();
    cashFlowPage.verifyInvalidTextTyped();
    cashFlowPage.verifyErrorsOnPage();
    cashFlowPage.verifyMonths();
    cashFlowPage.verifyErrorsOnFields();
    cashFlowPage.enterValidData("1000", 1000, 100, "4000", "5000");
    cashFlowPage = cashFlowPage.submitWithErrors();
    cashFlowPage.verifyErrorsOnPage("Indebtedness rate of the client is 175 % which is greater than allowed value of 49 %.");
    cashFlowPage.enterValidData("1000", 1000, 100, "5000", "400");
    CreateLoanAccountReviewInstallmentPage reviewPage = cashFlowPage.clickContinue();
    reviewPage.verifyCashFlow(100, 2000, new String[] { "100", "1858", "1445", "1716", "2334.7", "2600" }, new String[] { "0", "15.5", "37.2", "28.5", "6.6", "0" });
    reviewPage = reviewPage.clickPreview();
    reviewPage.verifyErrorsOnPage("Repayment Capacity of the client is 127.06 % which should be greater than the required value of 400.0 %");
    cashFlowPage = reviewPage.editCashFlow();
    cashFlowPage.enterValidData("1000", 1000, 1100, "5000", "400");
    reviewPage = cashFlowPage.clickContinue();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = reviewPage.clickPreviewAndNavigateToPreviewPage();
    createLoanAccountPreviewPage.verifyLoanAmount("2,000");
    createLoanAccountPreviewPage.verifyInterestTypeInLoanPreview("Declining Balance");
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submit();
    createLoanAccountConfirmationPage.isTextPresentInPage("View loan account details now");
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyDisbursalDate("12/10/2010");
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    String[][] tableAfterLastInstallment = { { "Future Installments", "", "", "", "", "", "" }, { "1", "19-Oct-2010", "-", "163.7", "7.3", "0", "0", "0", "171" }, { "2", "26-Oct-2010", "-", "164.3", "6.7", "0", "0", "0", "171" }, { "3", "02-Nov-2010", "-", "165", "6", "0", "0", "0", "171" }, { "4", "09-Nov-2010", "-", "165.6", "5.4", "0", "0", "0", "171" }, { "5", "16-Nov-2010", "-", "166.2", "4.8", "0", "0", "0", "171" }, { "6", "23-Nov-2010", "-", "166.8", "4.2", "0", "0", "0", "171" }, { "7", "30-Nov-2010", "-", "167.5", "3.5", "0", "0", "0", "171" }, { "8", "07-Dec-2010", "-", "168.1", "2.9", "0", "0", "0", "171" }, { "9", "14-Dec-2010", "-", "168.7", "2.3", "0", "0", "0", "171" }, { "10", "21-Dec-2010", "-", "169.3", "1.7", "0", "0", "0", "171" }, { "11", "28-Dec-2010", "-", "169.9", "1.1", "0", "0", "0", "171" }, { "12", "04-Jan-2011", "-", "164.9", "0.4", "0", "0", "0", "165.3" } };
    viewRepaymentSchedulePage.verifyScheduleTable(tableAfterLastInstallment);
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
    editLoanAccountInformationPage.verifyInstallments("12");
    editLoanAccountInformationPage.verifyInterestRate("19");
    editLoanAccountInformationPage.verifyDisbursalDate("12", "10", "2010");
    editLoanAccountInformationPage.verifyLoanAmount("2000.0");
    applicationDatabaseOperation.updateLSIM(0);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) EditLoanAccountInformationPage(org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateLoanAccountCashFlowPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountCashFlowPage) 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) Test(org.testng.annotations.Test)

Example 20 with ViewRepaymentSchedulePage

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

the class CreateLSIMClientLoanAccountTest method createLSIMLoanAndCheckAmountAndInstallmentDate.

private String createLSIMLoanAndCheckAmountAndInstallmentDate(CreateLoanAccountSearchParameters searchParameters, CreateLoanAccountSubmitParameters submitAccountParameters, String expectedDate) {
    LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    loanAccountPage.verifyLoanAmount(submitAccountParameters.getAmount());
    String loanId = loanAccountPage.getAccountId();
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(4, 2, expectedDate);
    return loanId;
}
Also used : ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Aggregations

ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)21 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)15 Test (org.testng.annotations.Test)10 DateTime (org.joda.time.DateTime)8 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)8 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)7 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)7 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)6 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)6 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)5 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)4 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)4 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)3 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)3 TransactionHistoryPage (org.mifos.test.acceptance.framework.loan.TransactionHistoryPage)3 ImportTransactionsConfirmationPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage)2 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)2