use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class EditLoanProductTest method editExistingLoanProduct.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // one of the dependent methods throws Exception
void editExistingLoanProduct() throws Exception {
EditLoanProductPage editLoanProductPage = createNewLoanProductAndNavigateToEditLoanPage();
editLoanProductPage.verifyPage();
SubmitFormParameters formParameters = new SubmitFormParameters();
formParameters.setDescription("Modified Description");
formParameters.setMaxInterestRate("44");
formParameters.setMinInterestRate("3");
formParameters.setDefaultInterestRate("18");
EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitDescriptionAndInterestChanges(formParameters);
LoanProductDetailsPage loanProductDetailsPage = editLoanProductPreviewPage.submit();
loanProductDetailsPage.verifyPage();
loanProductDetailsPage.editLoanProduct();
editLoanProductPage.verifyPage();
editLoanProductPage.verifyModifiedDescriptionAndInterest(formParameters);
}
use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class LoanImportTest method verifyImportLoanAccountsToClient.
/**
* MIFOS-5662: Add the possibility to import new Loans data.
* Test loads basic xls spreadsheet and test for rows parsed with errors. Then submits successfully parsed rows.
* Accounts are imported to client.
*/
private void verifyImportLoanAccountsToClient(int loanRecurrenceTypeId, boolean enableLSIM, int[] skipErrorLineIndices) throws Exception {
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_dbunit.xml", dataSource, selenium);
//changing date so dates in xls spreadsheet will be appropriate
targetTime = new DateTime(2012, 6, 22, 12, 0, 0, 0);
DateTimeUpdaterRemoteTestingService dtUpdate = new DateTimeUpdaterRemoteTestingService(selenium);
dtUpdate.setDateTime(targetTime);
applicationDatabaseOperation.updateLSIM((enableLSIM) ? 1 : 0);
ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
try {
manageRolePage.enablePermission("8_7");
} catch (AssertionError ex) {
Logger.getAnonymousLogger().info("Permission is marked.");
}
manageRolePage.submitAndGotoViewRolesPage();
if (!valuesDefined) {
valuesDefined = defineValuesForProducts();
}
String succesNumber = "1";
String errorNumber = Integer.toString(27 - skipErrorLineIndices.length);
String testID = "TID1";
arrayOfErrors = buildArrayOfErrorsForImportLoanTest(testID, skipErrorLineIndices);
SubmitFormParameters parameters = loanProductTestHelper.defineLoanProductParameters(10, 100, 1, 1, loanRecurrenceTypeId);
parameters.setOfferingName(productForClient);
parameters.setMinLoanAmount("5");
parameters.setMaxLoanAmount("1000");
parameters.setMinInterestRate("1");
parameters.setMaxInterestRate("50");
parameters.setMinInstallemnts("2");
parameters.setMaxInstallments("50");
parameters.setGracePeriodType(SubmitFormParameters.GRACE_ON_ALL_REPAYMENTS);
parameters.setGracePeriodDuration("10");
try {
loanProductTestHelper.defineNewLoanProduct(parameters);
} catch (AssertionError ae) {
Logger.getAnonymousLogger().info("Product exists");
}
String importFile = this.getClass().getResource("/ImportLoanAccountsTest.xls").toString();
ImportLoansReviewPage reviewPage = adminTestHelper.loadImportLoansFileAndSubmitForReview(importFile);
reviewPage.validateErrors(arrayOfErrors);
reviewPage.validateSuccesText(succesNumber);
ImportLoansSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
summaryPage.verifySuccesString(succesNumber);
summaryPage.verifyErrorStroing(errorNumber);
valuesDefined = false;
}
use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class LoanAccountOverdueInterestTest method verifyPayOverdueInstalment.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyPayOverdueInstalment() throws Exception {
SubmitFormParameters loanParameters = FormParametersHelper.getWeeklyLoanProductParameters();
loanParameters.setOfferingName("OverdueLoan");
loanProductTestHelper.defineNewLoanProduct(loanParameters);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Stu");
searchParameters.setLoanProduct("OverdueLoan");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
LoanAccountPage loanPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
String loanId = loanPage.getAccountId();
loanPage.changeAccountStatusToAccepted();
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setDisbursalDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
disburseParameters.setDisbursalDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
disburseParameters.setDisbursalDateYYYY(Integer.toString(systemDateTime.getYear()));
disburseParameters.setPaymentType(PaymentParameters.CASH);
loanTestHelper.disburseLoan(loanId, disburseParameters);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
systemDateTime = systemDateTime.plusDays(20);
dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
ViewRepaymentSchedulePage repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTablePrincipal(3, "17.3");
repaymentPage.verifyRepaymentScheduleTableInterest(3, "3.7 (0)");
repaymentPage.verifyRepaymentScheduleTablePrincipal(4, "17.4");
repaymentPage.verifyRepaymentScheduleTableInterest(4, "3.6 (0)");
PaymentParameters params = new PaymentParameters();
params.setTransactionDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
params.setTransactionDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
params.setTransactionDateYYYY(Integer.toString(systemDateTime.getYear()));
params.setPaymentType(PaymentParameters.CASH);
params.setAmount("4.2");
loanPage = repaymentPage.navigateToApplyPaymentPage().submitAndNavigateToApplyPaymentConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
loanPage = navigationHelper.navigateToLoanAccountPage(loanId);
repaymentPage = loanPage.navigateToRepaymentSchedulePage();
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(3, "0");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(3, "3.7");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(5, "17.3");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(5, "0 (3.7)");
repaymentPage.verifyRepaymentScheduleTableAfterPayPrincipal(6, "17.4");
repaymentPage.verifyRepaymentScheduleTableAfterPayInterest(6, "3.1 (0.5)");
}
use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class CreateClientLoanAccountTest method createDecliningBalanceIRLoanWithFees.
public void createDecliningBalanceIRLoanWithFees() throws SQLException {
int interestRate = 25;
int loanAmount = 120;
int numberOfInstallments = 6;
feeTestHelper.createNoRateFee("fixedFee5629", FeesCreatePage.SubmitFormParameters.LOAN, "Upfront", 5);
feeTestHelper.createPeriodicRateFee("periodicFee5629", FeesCreatePage.SubmitFormParameters.LOAN, FeesCreatePage.SubmitFormParameters.WEEKLY_FEE_RECURRENCE, 1, 4, FeesCreatePage.SubmitFormParameters.LOAN_AMOUNT_INTEREST);
SubmitFormParameters dbIrLoanProductParams = loanProductTestHelper.defineLoanProductParameters(numberOfInstallments, loanAmount, interestRate, DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION, WEEKLY_RECURRENCE_TYPE_ID);
dbIrLoanProductParams.setOfferingName("DbIrProduct5629");
loanProductTestHelper.defineNewLoanProduct(dbIrLoanProductParams);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client1233266063395");
searchParameters.setLoanProduct("DbIrProduct5629");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAdditionalFee1("periodicFee5629");
submitAccountParameters.setAdditionalFee2("fixedFee5629");
ViewRepaymentSchedulePage schedulePage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
String[] expectedInterestAmounts = { "0.6", "0.5", "0.4", "0.3", "0.2", "0.7" };
String[] expectedFeeAmounts = { "9.9", "4.9", "4.9", "4.9", "4.9", "4.8" };
for (int i = 0; i < numberOfInstallments; i++) {
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.INTEREST_COLUMN, expectedInterestAmounts[i]);
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.FEE_COLUMN, expectedFeeAmounts[i]);
}
}
use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class UpdateCustomPropertiesTest method changeMaxInterestRateToFive.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void changeMaxInterestRateToFive() throws Exception {
propertiesHelper.setMaxInterest(5);
SubmitFormParameters submitFormParameters = FormParametersHelper.getWeeklyLoanProductParameters();
//invalid value
submitFormParameters.setMaxInterestRate("12");
submitFormParameters.setMinInterestRate("1");
submitFormParameters.setDefaultInterestRate("3");
verifyInvalidInterestInLoanProduct(submitFormParameters, true);
propertiesHelper.setMaxInterest(999);
}
Aggregations