use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage 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");
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage in project head by mifos.
the class EditLoanProductTest method editExistingLoanAndSavingsProduct.
//http://mifosforge.jira.com/browse/MIFOSTEST-312
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void editExistingLoanAndSavingsProduct() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 2, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
EditLoanProductPage editLoanProductPage = createNewLoanProductAndNavigateToEditLoanPage();
editLoanProductPage.verifyPage();
SubmitFormParameters formParameters = new SubmitFormParameters();
formParameters = cleanFormParameters(formParameters);
EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
String error = selenium.getText("EditLoanProduct.error.message");
verifyError(error, "Please specify the Product instance name.", "Please specify the Short name.", "Please select the Product category.", "Please specify the Applicable for.", "Please select the Interest rate type.", "Please select the Status.", "Please specify the Min Interest rate.", "Please specify the Max Interest rate.", "Please select the Status.", "Please specify the Min Interest rate.", "Please specify the Default Interest rate.");
//TODO js - missing error msg
//Assert.assertEquals(error.contains("Please specify the Start date."), true);
formParameters = setFormParameters(formParameters);
editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
error = selenium.getText("EditLoanProduct.error.message");
//TODO js - missing error msg
//Assert.assertEquals(error.contains("The Start date cannot be changed because either the product is active or the date specified is invalid."), true);
Assert.assertEquals(error.contains("Please specify a valid Max Interest rate. Max Interest rate should be greater than or equal to Min Interest rate."), true);
Assert.assertEquals(error.contains("Please specify valid Default Interest rate. Default Interest rate should be between the Min and Max Interest rate, inclusive of the two."), true);
formParameters = setCorrectFormParameters(formParameters);
editLoanProductPreviewPage = editLoanProductPage.submitRequiredDescriptionAndInterestChanges(formParameters);
LoanProductDetailsPage loanProductDetailsPage = editLoanProductPreviewPage.submit();
loanProductDetailsPage.verifyPage();
loanProductDetailsPage.editLoanProduct();
editLoanProductPage.verifyPage();
editLoanProductPage.verifyModifiedLoanProduct(formParameters);
///////////////////////SAVINGS////////////////////
SavingsProductHelper savingsProductHelper = new SavingsProductHelper(selenium);
SavingsProductParameters params = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2011, 2, 2, 12, 0, 0, 0), SavingsProductParameters.VOLUNTARY, SavingsProductParameters.CENTERS);
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
EditSavingsProductPage editSavingsProductPage = confirmationPage.navigateToSavingsProductDetails().editSavingsProduct();
DefineNewSavingsProductPage.SubmitSavingsFormParameters formSavingsParameters = new DefineNewSavingsProductPage.SubmitSavingsFormParameters();
formSavingsParameters = cleanFormSavingsParameters(formSavingsParameters);
EditSavingsProductPreviewPage editSavingsProductPreviewPage = editSavingsProductPage.submitRequiredDescriptionAndInterestChanges(formSavingsParameters);
error = selenium.getText("error.messages");
verifyError(error, "Please specify the Product instance name.", "Please specify the Short name.", "Please select the Product category.", "Please specify the Start date. Day must be in range (1-31).", "Please specify the Start date. Month must be in range (1-12).", "The Start date can be anything between current date and 1 year from the current date.", "Please select the Applicable for.", "Please select the Type of deposits.", "Please specify the Interest rate. Interest must be in range (0-100).", "Please select the Balance used for Interest calculation.", "Please specify the Time period for Interest calculation.", "Please specify the Frequency of Interest posting to accounts.");
formSavingsParameters = setFormSavingsParameters(formSavingsParameters);
editSavingsProductPreviewPage = editSavingsProductPage.submitRequiredDescriptionAndInterestChanges(formSavingsParameters);
SavingsProductDetailsPage savingsProductDetailsPage = editSavingsProductPreviewPage.submit();
savingsProductDetailsPage.editSavingsProduct();
editSavingsProductPage.verifyModifiedSavingsProduct(formSavingsParameters);
}
Aggregations