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");
}
Aggregations