Search in sources :

Example 1 with ViewSavingsProductsPage

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

Aggregations

DateTime (org.joda.time.DateTime)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)1 EditSavingsProductPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPage)1 EditSavingsProductPreviewPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPreviewPage)1 SavingsProductDetailsPage (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage)1 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)1 ViewSavingsProductsPage (org.mifos.test.acceptance.framework.savingsproduct.ViewSavingsProductsPage)1 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)1