use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class DefineNewLoanProductTest method createDailyLoanProduct.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createDailyLoanProduct() throws Exception {
SubmitFormParameters formParameters = FormParametersHelper.getDailyLoanProductParameters();
new NavigationHelper(selenium).navigateToAdminPage().verifyPage().defineLoanProduct(formParameters);
}
use of org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters in project head by mifos.
the class DefineNewLoanProductTest method createWeeklyLoanProduct.
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createWeeklyLoanProduct() throws Exception {
SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
new NavigationHelper(selenium).navigateToAdminPage().verifyPage().defineLoanProduct(formParameters);
}
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)");
}
Aggregations