use of org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage 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);
}
use of org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage in project head by mifos.
the class LoanProductTestHelper method editLoanProductIncludeQuestionsGroups.
public void editLoanProductIncludeQuestionsGroups(String loanProduct, String... questionGroup) {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
ViewLoanProductsPage viewLoanProducts = adminPage.navigateToViewLoanProducts();
LoanProductDetailsPage loanProductDetailsPage = viewLoanProducts.viewLoanProductDetails(loanProduct);
EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
DefineNewLoanProductPage.SubmitFormParameters formParameters = new DefineNewLoanProductPage.SubmitFormParameters();
formParameters.setQuestionGroups(Arrays.asList(questionGroup));
EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitQuestionGroupChanges(formParameters);
editLoanProductPreviewPage.submit();
}
use of org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage in project head by mifos.
the class LoanProductTestHelper method enableInterestWaiver.
public void enableInterestWaiver(String loanProduct, boolean interestWaiver) {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
ViewLoanProductsPage viewLoanProducts = adminPage.navigateToViewLoanProducts();
LoanProductDetailsPage loanProductDetailsPage = viewLoanProducts.viewLoanProductDetails(loanProduct);
EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
DefineNewLoanProductPage.SubmitFormParameters formParameters = new DefineNewLoanProductPage.SubmitFormParameters();
formParameters.setInterestWaiver(interestWaiver);
EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitInterestWaiverChanges(formParameters);
editLoanProductPreviewPage.submit();
}
Aggregations