Search in sources :

Example 41 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage 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 42 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class AdditionalSavingsAccountTest method savingsProductUpdateableFields.

//http://mifosforge.jira.com/browse/MIFOSTEST-725
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsProductUpdateableFields() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
    //When
    SavingsProductParameters params = savingsProductHelper.getMandatoryClientsMinimumBalanceSavingsProductParameters(targetTime);
    params.setBalanceUsedForInterestCalculation(SavingsProductParameters.AVERAGE_BALANCE);
    params.setTypeOfDeposits(SavingsProductParameters.VOLUNTARY);
    params.setStartDateDD("1");
    params.setStartDateMM("2");
    params.setStartDateYYYY("2011");
    String productName = params.getProductInstanceName();
    String savingsId = createSavingsAccount(params);
    DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "2000");
    //Then
    targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "2.7");
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewSavingsProductsPage viewSavingsProducts = adminPage.navigateToViewSavingsProducts();
    viewSavingsProducts.verifyPage();
    SavingsProductDetailsPage savingsProductDetailsPage = viewSavingsProducts.viewSavingsProductDetails(productName);
    EditSavingsProductPage editSavingsProductPage = savingsProductDetailsPage.editSavingsProduct();
    selenium.type("interestRate", "10");
    selenium.type("minBalanceRequiredForInterestCalculation", "100");
    EditSavingsProductPreviewPage editSavingsProductPreviewPage = editSavingsProductPage.editSubmit();
    savingsProductDetailsPage = editSavingsProductPreviewPage.submit();
    makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "2000");
    targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "33.1");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) EditSavingsProductPage(org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPage) SavingsProductDetailsPage(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) EditSavingsProductPreviewPage(org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPreviewPage) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters) ViewSavingsProductsPage(org.mifos.test.acceptance.framework.savingsproduct.ViewSavingsProductsPage)

Example 43 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class PersonnelTest method editUserTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true, groups = { "acceptance" })
public void editUserTest() throws Exception {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    UserViewDetailsPage userDetailsPage = userHelper.createUser(adminPage.getAdminUserParameters(), "MyOfficeDHMFT");
    EditUserDataPage editUserPage = userDetailsPage.navigateToEditUserDataPage();
    CreateUserParameters formParameters = new CreateUserParameters();
    formParameters.setFirstName("Update");
    formParameters.setLastName("User" + StringUtil.getRandomString(8));
    formParameters.setEmail("xxx.yyy@xxx.zzz");
    EditUserPreviewDataPage editPreviewDataPage = editUserPage.submitAndGotoEditUserPreviewDataPage(formParameters);
    UserViewDetailsPage userDetailsPage2 = editPreviewDataPage.submit();
    userDetailsPage2.verifyModifiedNameAndEmail(formParameters);
}
Also used : EditUserPreviewDataPage(org.mifos.test.acceptance.framework.user.EditUserPreviewDataPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) UserViewDetailsPage(org.mifos.test.acceptance.framework.user.UserViewDetailsPage) EditUserDataPage(org.mifos.test.acceptance.framework.user.EditUserDataPage) Test(org.testng.annotations.Test)

Example 44 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTest method createQuestionGroup.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createQuestionGroup() throws Exception {
    try {
        AdminPage adminPage = createQuestions(qTitle1, qTitle2, qTitle3);
        CreateQuestionGroupPage createQuestionGroupPage = getCreateQuestionGroupPage(adminPage);
        testMissingMandatoryInputs(createQuestionGroupPage);
        testCreateQuestionGroup(createQuestionGroupPage, qgTitle1, APPLIES_TO_CREATE_CLIENT, true, SECTION_DEFAULT, asList(qTitle1, qTitle2), asList(qTitle3), qTitle4);
        testShouldAllowDuplicateTitlesForQuestionGroup();
        testCancelCreateQuestionGroup(getCreateQuestionGroupPage(new AdminPage(selenium)));
        testViewQuestionGroups();
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle1);
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle2);
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle3);
    }
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage) Test(org.testng.annotations.Test)

Example 45 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTest method testViewQuestionGroups.

private void testViewQuestionGroups() {
    ViewAllQuestionGroupsPage viewQuestionGroupsPage = getViewQuestionGroupsPage(new AdminPage(selenium));
    testViewQuestionGroups(viewQuestionGroupsPage);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle1, SECTION_DEFAULT, asList(qTitle1, qTitle2), asList(qTitle1));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle1, SECTION_MISC, asList(qTitle4), EMPTY_LIST);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle2, SECTION_MISC, asList(qTitle1, qTitle3), asList(qTitle1));
    testEditQuestionGroupDetail(viewQuestionGroupsPage.navigateToQuestionGroupDetailPage(qgTitle2));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, SECTION_MISC, asList(qTitle1, qTitle3), asList(qTitle1));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, "New Section", asList(qTitle4), EMPTY_LIST);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, "Hello World", asList(qTitle5), EMPTY_LIST);
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage)

Aggregations

AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)87 Test (org.testng.annotations.Test)33 HomePage (org.mifos.test.acceptance.framework.HomePage)9 CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)8 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)7 CreateUserParameters (org.mifos.test.acceptance.framework.user.CreateUserParameters)7 DateTime (org.joda.time.DateTime)6 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)6 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)6 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)6 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)5 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)5 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)4 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)4 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)4 ViewLoanProductsPage (org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage)4