Search in sources :

Example 11 with ViewRepaymentSchedulePage

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

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

the class RedoNewGlimLoanDisbursalTest method checkRedoLoanDisbursal.

@Test(enabled = true)
public void checkRedoLoanDisbursal() throws Exception {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    RedoLoanDisbursalSearchPage redoLoanDisbursalSearchPage = adminPage.navigateToRedoLoanDisbursal();
    RedoLoanDisbursalSearchResultsPage redoLoanDisbursalSearchResultsPage = redoLoanDisbursalSearchPage.searchAndNavigateToRedoLoanDisbursalPage("Default Group");
    RedoLoanDisbursalChooseLoanInstancePage redoLoanDisbursalChooseLoanInstancePage = redoLoanDisbursalSearchResultsPage.navigateToRedoLoanDisbursalChooseLoanProductPage("Default Group:ID0002-000000011");
    RedoLoanDisbursalEntryPage redoLoanDisbursalEntryPage = redoLoanDisbursalChooseLoanInstancePage.submitAndNavigateToRedoLoanDisbursalEntryPage("WeeklyGroupDeclineLoanWithPeriodicFee");
    RedoLoanDisbursalParameters redoLoanDisbursalParameters = new RedoLoanDisbursalParameters();
    redoLoanDisbursalParameters.addClient(0, "1000", "0001-Cow Purchase");
    redoLoanDisbursalParameters.addClient(1, "2000", "0001-Cow Purchase");
    redoLoanDisbursalParameters.setInterestRate("10.0");
    redoLoanDisbursalParameters.setDisbursalDateDD("23");
    //one month earlier
    redoLoanDisbursalParameters.setDisbursalDateMM("02");
    redoLoanDisbursalParameters.setDisbursalDateYYYY("2011");
    RedoLoanDisbursalSchedulePreviewPage redoLoanDisbursalPreviewSchedulePage = redoLoanDisbursalEntryPage.submitWithGLIMandLSIPAndNavigateToPreviewPage(redoLoanDisbursalParameters, true);
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 0, "0", "10/03/2011");
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 0, "0", "10/03/2011");
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 1, "200", "11/03/2011");
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 1, "300", "11/03/2011");
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(12, 2, "100", "12/03/2011");
    redoLoanDisbursalPreviewSchedulePage.typeIndividualPaidInstallment(13, 2, "100", "12/03/2011");
    LoanAccountPage loanAccountDetailsPage = redoLoanDisbursalPreviewSchedulePage.submitAndNavigateToRedoLoanDisbursalPreviewPage(true).submitAndNavigateToLoanAccountConfirmationPage().navigateToLoanAccountDetailsPage();
    loanAccountDetailsPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountDetailsPage.verifyAccountSummary("512", "18/03/2011", "209");
    loanAccountDetailsPage.verifyNumberOfInstallments("10");
    loanAccountDetailsPage.verifyTotalAmountPaid("700");
    loanAccountDetailsPage.verifyTotalOriginalLoan("3,033");
    loanAccountDetailsPage.verifyPrincipalBalance("2,315.5");
    loanAccountDetailsPage.verifyInterestOriginal("33");
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "297.3", "5.7", "0", "0", "14", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "297.8", "5.2", "0", "0", "8", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(5, "3", "11-Mar-2011", "12-Mar-2011", "89.4", "4.6", "0", "0", "1", "94");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "209", "0", "0", "0", "1", "209");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "299", "4", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "299.5", "3.5", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "300.1", "2.9", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "300.7", "2.3", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "301.2", "1.8", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "301.8", "1.2", "0", "0", "0", "303");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "304.2", "1.8", "0", "0", "0", "306");
    loanAccountDetailsPage = viewRepaymentSchedulePage.navigateToLoanAccountPage().navigateToIndividualLoanAccountPage(0);
    loanAccountDetailsPage.verifyAccountSummary("104", "18/03/2011", "3");
    loanAccountDetailsPage.verifyNumberOfInstallments("10");
    loanAccountDetailsPage.verifyTotalAmountPaid("300");
    loanAccountDetailsPage.verifyTotalOriginalLoan("1,011");
    loanAccountDetailsPage.verifyPrincipalBalance("705.1");
    loanAccountDetailsPage.verifyInterestOriginal("11");
    viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "99.1", "1.9", "0", "0", "14", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "99.3", "1.7", "0", "0", "8", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(5, "3", "11-Mar-2011", "12-Mar-2011", "96.5", "1.5", "0", "0", "1", "98");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "3", "0", "0", "0", "1", "3");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "99.7", "1.3", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "99.8", "1.2", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "100", "1", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "100.2", "0.8", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "100.4", "0.6", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "100.6", "0.4", "0", "0", "0", "101");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "101.4", "0.6", "0", "0", "0", "102");
    loanAccountDetailsPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    loanAccountDetailsPage = loanAccountDetailsPage.navigateToGroupLoanPageFromIndividualLoanPage();
    loanAccountDetailsPage = loanAccountDetailsPage.navigateToIndividualLoanAccountPage(1);
    loanAccountDetailsPage.verifyAccountSummary("408", "18/03/2011", "206");
    loanAccountDetailsPage.verifyNumberOfInstallments("10");
    loanAccountDetailsPage.verifyTotalAmountPaid("400");
    loanAccountDetailsPage.verifyTotalOriginalLoan("2,022");
    loanAccountDetailsPage.verifyPrincipalBalance("1,607.3");
    loanAccountDetailsPage.verifyInterestOriginal("22");
    viewRepaymentSchedulePage = loanAccountDetailsPage.navigateToViewRepaymentSchedule();
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(3, "1", "25-Feb-2011", "11-Mar-2011", "198.2", "3.8", "0", "0", "14", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(4, "2", "04-Mar-2011", "12-Mar-2011", "194.5", "3.5", "0", "0", "8", "198");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(6, "2", "04-Mar-2011", "-", "4", "0", "0", "0", "8", "4");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(7, "3", "11-Mar-2011", "-", "198.9", "3.1", "0", "0", "4", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(9, "4", "18-Mar-2011", "-", "199.3", "2.7", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(10, "5", "25-Mar-2011", "-", "199.7", "2.3", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(11, "6", "01-Apr-2011", "-", "200.1", "1.9", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(12, "7", "08-Apr-2011", "-", "200.5", "1.5", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(13, "8", "15-Apr-2011", "-", "200.8", "1.2", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(14, "9", "22-Apr-2011", "-", "201.2", "0.8", "0", "0", "0", "202");
    viewRepaymentSchedulePage.verifyRepaymentScheduleTableRow(15, "10", "29-Apr-2011", "-", "202.8", "1.2", "0", "0", "0", "204");
}
Also used : RedoLoanDisbursalSchedulePreviewPage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSchedulePreviewPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) RedoLoanDisbursalParameters(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) RedoLoanDisbursalSearchPage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSearchPage) RedoLoanDisbursalChooseLoanInstancePage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalChooseLoanInstancePage) RedoLoanDisbursalEntryPage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalEntryPage) RedoLoanDisbursalSearchResultsPage(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSearchResultsPage) Test(org.testng.annotations.Test)

Example 13 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 14 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 15 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)

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