use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class SavingsPaymentTest method testPermissionForPaymentFromSavings.
public void testPermissionForPaymentFromSavings() {
String loanGlobalNum = setUpLoanAccount();
String savingsGlobalNum = setUpSavingsAccount();
String errorMessage = "You do not have permission to make payment to the account using Savings Account Transfer";
//first uncheck permission and see if access denied page is displayed
//while trying transfer from savings
ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
if (manageRolePage.isPermissionEnable("5_1_11")) {
manageRolePage.disablePermission("5_1_11");
}
manageRolePage.submitAndGotoViewRolesPage();
CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
loanSearchParams.setSearchString(loanGlobalNum);
LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanGlobalNum);
ApplyPaymentPage applyPaymentPage = loanAccountPage.navigateToApplyPayment();
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setAmount(String.valueOf(TRANSFER_AMOUNT));
paymentParams.setPaymentType(PaymentParameters.TRANSFER);
paymentParams.setSavingsAccountGlobalNum(savingsGlobalNum);
paymentParams.setTransactionDateDD("13");
paymentParams.setTransactionDateMM("03");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setSavingsAccountBalance(String.valueOf(SAVINGS_START_BALANCE));
paymentParams.setSavingsAccountMaxWithdrawalAmount(String.valueOf(0));
paymentParams.setSavingsAccountType("Voluntary");
paymentParams.setSavingsAccountName("MonthlyClientSavingsAccount");
try {
applyPaymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParams);
} catch (AssertionError e) {
Assert.assertTrue(selenium.isTextPresent(errorMessage));
}
//now enable permission and validate transfer success
manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
if (!manageRolePage.isPermissionEnable("5_1_11")) {
manageRolePage.enablePermission("5_1_11");
}
manageRolePage.submitAndGotoViewRolesPage();
navigationHelper.navigateToLoanAccountPage(loanGlobalNum).navigateToApplyPayment().submitAndNavigateToApplyPaymentConfirmationPage(paymentParams).submitAndNavigateToLoanAccountDetailsPage();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class VariableInstalmentLoanTest method setLoanSearchParameters.
private CreateLoanAccountSearchParameters setLoanSearchParameters() {
CreateLoanAccountSearchParameters accountSearchParameters = new CreateLoanAccountSearchParameters();
accountSearchParameters.setSearchString(clientName);
accountSearchParameters.setLoanProduct(loanProductName);
return accountSearchParameters;
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class NoDBUnitAdditionalHolidayTest method createMonthlyLoan.
private LoanAccountPage createMonthlyLoan(final String year) {
// create a loan that has its repayment on the 1st of every month
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client - Mary Monthly");
searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1234.0");
submitAccountParameters.setDd("01");
submitAccountParameters.setMm("03");
submitAccountParameters.setYy(year);
LoanAccountPage page = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
return page;
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class ClientLoanDisbursalTest method verifyAcceptedPaymentTypesForDisbursementsOfLoan.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-249
void verifyAcceptedPaymentTypesForDisbursementsOfLoan() throws Exception, InterruptedException {
// When
NavigationHelper navigationHelper = new NavigationHelper(selenium);
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
adminPage = navigationHelper.navigateToAdminPage();
defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
searchParams.setSearchString("Stu1233266063395 Client1233266063395");
//Extension https://mifosforge.jira.com/browse/MIFOSTEST-1194
LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
DisburseLoanPage disburseLoanPage = loanAccountPage.navigateToDisburseLoan();
DisburseLoanParameters params = new DisburseLoanParameters();
params.setDisbursalDateDD("20");
params.setDisbursalDateMM("03");
params.setDisbursalDateYYYY("2011");
params.setPaymentType(params.CASH);
disburseLoanPage.verifyDisbursalDateIsFutureDate(params);
//disburseLoanPage.submitWithWrongParams(params, "Date of transaction can not be a future date");
params.setDisbursalDateDD("01");
params.setDisbursalDateMM("03");
params.setDisbursalDateYYYY("2011");
disburseLoanPage.verifyDisbursalDateIsPriorToClientMeetingSchedule(params);
params.setDisbursalDateDD("04");
params.setDisbursalDateMM("03");
params.setDisbursalDateYYYY("2011");
//Then
disburseLoanPage.verifyModeOfPayments();
disburseLoanPage.submitAndNavigateToDisburseLoanConfirmationPage(params).submitAndNavigateToLoanAccountPage();
String[] locators = { "Payment rcvd.", "accountActivityTable.2.1" };
loanAccountPage.navigateToViewLoanAccountActivityPage().verifyAllElementsArePresent(locators);
//When
disburseLoanPage = navigationHelper.navigateToLoanAccountPage("000100000000020").navigateToDisburseLoan();
//Then
disburseLoanPage.verifyModeOfPayments();
disburseLoanPage.verifyPaymentModesOfPaymentAreEmpty();
disburseLoanPage.verifyPaymentModeOfPaymentIsEditable("payment mode of payment must be editable when a disbursal fee exists.");
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters in project head by mifos.
the class LoanAccountCycleTest method verifyAmountByCycleAndInstallmentsByLastAmount.
/**
* Verify loan amount with number of installments by last loan amount can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-110
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountByCycleAndInstallmentsByLastAmount() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product110");
productParams.setOfferingShortName("p110");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] cycleLoanAmount = getAmountsByCycle();
productParams.setCycleLoanAmount(cycleLoanAmount);
productParams.setCalculateInstallments(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] calculateInstallments = getInstallmentsFromLastAmount();
productParams.setInstallmentsByLastLoanAmount(calculateInstallments);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product110");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
loanProductDetailsPage.verifyInstallmentTableTypeFromLastAmount(calculateInstallments);
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "5", "10", "5" });
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "5", "10", "5" });
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "10", "30", "25" });
}
Aggregations