use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class CreateGLIMLoanAccountTest method newWeeklyGLIMAccount.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void newWeeklyGLIMAccount() throws Exception {
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "301", "0012-Sheep Purchase");
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "401", "0012-Sheep Purchase");
//MIFOS-5703
applicationDatabaseOperation.updateLSIM(1);
EditLoanAccountInformationPage editPage = loanAccountEntryPage.submitAndNavigateToGLIMLoanAccountConfirmationPage().navigateToLoanAccountDetailsPage().navigateToEditAccountInformation();
editPage.verifyRepaymentDayAccessibility(true);
editPage.setWeekFrequency("5");
LoanAccountPage loanPage = editPage.submitAndNavigateToAccountInformationPreviewPage().submitAndNavigateToLoanAccountPage();
loanPage.verifyFrequencyInstallments("5");
EditLoanAccountStatusParameters statusParams = new EditLoanAccountStatusParameters();
statusParams.setNote("GLIM test");
statusParams.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanPage.changeAccountStatus(statusParams);
editPage = loanPage.navigateToEditAccountInformation();
editPage.verifyRepaymentDayAccessibility(true);
editPage.navigateBack();
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("1");
disburseParams.setDisbursalDateMM("03");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanPage.disburseLoan(disburseParams);
editPage = loanPage.navigateToEditAccountInformation();
editPage.verifyRepaymentDayAccessibility(false);
applicationDatabaseOperation.updateLSIM(0);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class CreateGLIMLoanAccountTest method checkGLIMLoanCreatedBySubmitForApproval.
/*
* This test is to verify that you can edit a GLIM loan account after it has been
* dibursed without getting an invalid disbursal date error. See MIFOS-2597.
*/
// http://mifosforge.jira.com/browse/MIFOSTEST-132
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void checkGLIMLoanCreatedBySubmitForApproval() throws Exception {
//Given
applicationDatabaseOperation.updateGLIM(1);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setSearchString("Default Group");
formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyGLIMErrorMessage();
createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 3, 04, 15, 0, 0, 0));
createLoanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999.9", "0009-Horse");
createLoanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "9999.9", "0001-Cow Purchase");
createLoanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "9999.9", "0003-Goat Purchase");
createLoanAccountEntryPage.selectGLIMClients(3, "Holiday TestClient Client Id: 0002-000000023", "9999.9", "0003-Goat Purchase");
selectAdditionalFees();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyFirstInstallmentAndDisbursalDateOnReviewPage();
verifyAdditionalFeesOnReviewPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
verifyFirstInstallmentAndDisbursalDateOnPreviewPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("4");
loanAccountPage.verifyDisbursalDate("04/03/2011");
loanAccountPage.verifyPrincipalOriginal("39999.6");
loanAccountPage.verifyLoanTotalBalance("41147.0");
loanAccountPage.verifyFeesOriginal("410.0");
loanAccountPage.verifyInterestOriginal("737.4");
verifyFees();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "11-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "18-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "25-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "01-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100.0");
viewRepaymentSchedulePage.navigateToLoanAccountPage();
loanId = loanAccountPage.getAccountId();
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
statusParameters.setNote("Test");
loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
DisburseLoanParameters params = new DisburseLoanParameters();
params.setDisbursalDateDD("8");
params.setDisbursalDateMM("3");
params.setDisbursalDateYYYY("2011");
params.setPaymentType(DisburseLoanParameters.CASH);
loanTestHelper.disburseLoan(loanId, params);
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 15).toDateTimeAtStartOfDay());
EditLoanAccountInformationParameters editLoanAccountInformationParameters = new EditLoanAccountInformationParameters();
editLoanAccountInformationParameters.setExternalID("ID2323ID");
loanTestHelper.changeLoanAccountInformation(loanId, new CreateLoanAccountSubmitParameters(), editLoanAccountInformationParameters);
applicationDatabaseOperation.updateGLIM(0);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters 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.DisburseLoanParameters 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" });
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class LoanAccountCycleTest method verifyNumberOfInstallmentsSameForAllLoans.
/**
* Verify loan amount with number of installments is same for all loan can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-105
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyNumberOfInstallmentsSameForAllLoans() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("LastCycleBasedProduct");
productParams.setOfferingShortName("p105");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] cycleLoanAmount = getAmountsByCycle();
productParams.setCycleLoanAmount(cycleLoanAmount);
productParams.setMinInstallemnts("10");
productParams.setMaxInstallments("100");
productParams.setDefInstallments("50");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("LastCycleBasedProduct");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyLoanAmountTableTypeFromCycle(cycleLoanAmount);
loanProductDetailsPage.verifyInstallments("10", "100", "50");
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,000", "5,000", "3000.0" }, null, new String[] { "10", "100", "50" });
String loan1ID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "2,000", "6,000", "4000.0" }, null, new String[] { "10", "100", "50" });
String loan2ID = loanAccountPage.getAccountId();
loanTestHelper.repayLoan(loan1ID);
loanTestHelper.disburseLoan(loan2ID, disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "3,000", "7,000", "5000.0" }, null, new String[] { "10", "100", "50" });
}
Aggregations