use of org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters in project head by mifos.
the class LoanTestHelper method activateLoanAccount.
public void activateLoanAccount(String loanId) {
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(AccountStatus.LOAN_APPROVED.getStatusText());
editLoanAccountStatusParameters.setNote("Activate account");
changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
}
use of org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters in project head by mifos.
the class ApplyAdjustmentGroupLoanTest method adjustmentWithCommaTest.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void adjustmentWithCommaTest() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
loanAccountEntryPage.setDisbursalDate(new DateTime(2013, 2, 8, 15, 0, 0, 0));
loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null);
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null);
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
statusParameters.setNote("Test new GLIM");
loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
DisburseLoanParameters params = new DisburseLoanParameters();
params.setPaymentType(DisburseLoanParameters.CASH);
loanTestHelper.disburseLoan(loanId, params);
PaymentParameters paymentParameters = new PaymentParameters();
paymentParameters.setAmount("2500.0");
paymentParameters.setPaymentType(PaymentParameters.CASH);
paymentParameters.setTransactionDateDD("08");
paymentParameters.setTransactionDateMM("2");
paymentParameters.setTransactionDateYYYY("2013");
loanTestHelper.applyGroupPayment(loanId, paymentParameters);
loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmitGroupLoan("2500.0");
Assert.assertFalse(selenium.isTextPresent("stack trace"));
Assert.assertTrue(selenium.isTextPresent("2,500"));
}
use of org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters in project head by mifos.
the class CreateGroupLoanAccountTest method newWeeklyGroupLoanAccount.
//http://mifosforge.jira.com/browse/MIFOSTEST-303
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyGroupLoanAccount() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 25, 1, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setSearchString("groupWithoutLoan");
formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.setAmount("3000.0");
createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 2, 25, 15, 0, 0, 0));
selectAdditionalFees();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyFirstInstallmentDateAndDisbursalDateOnReviewPage();
verifyAdditionalFeesOnReviewPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
verifyFirstInstallmentDateAndDisbursalDateOnPreviewPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("4");
loanAccountPage.verifyDisbursalDate("25/02/2011");
loanAccountPage.verifyPrincipalOriginal("3,000");
loanAccountPage.verifyLoanTotalBalance("3,466");
loanAccountPage.verifyFeesOriginal("410");
loanAccountPage.verifyInterestOriginal("56");
verifyFees();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "04-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "11-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "18-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "25-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "749.4");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100");
viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
editLoanAccountStatusParameters.setNote("test");
loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
disburseParameters.setDisbursalDateDD("25");
disburseParameters.setDisbursalDateMM("02");
disburseParameters.setDisbursalDateYYYY("2011");
loanTestHelper.disburseLoan(loanId, disburseParameters);
}
use of org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters in project head by mifos.
the class CreateClientLoanAccountTest method getLoanStatusActive.
private void getLoanStatusActive(String loanId) {
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
editLoanAccountStatusParameters.setNote("test");
loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
disburseParameters.setDisbursalDateDD("01");
disburseParameters.setDisbursalDateMM("02");
disburseParameters.setDisbursalDateYYYY("2011");
//Then
loanTestHelper.disburseLoan(loanId, disburseParameters);
}
use of org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters in project head by mifos.
the class CreateGLIMLoanAccountTest method checkGLIMIndividualSchedule.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMIndividualSchedule() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
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", "9999", "0012-Sheep Purchase");
loanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999");
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999");
LoanAccountPage loanAccountPage = loanAccountEntryPage.navigateToReviewInstallmentsPage().clickPreviewAndGoToReviewLoanAccountPage().submitForApprovalAndNavigateToConfirmationPage().navigateToLoanAccountDetailsPage();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
EditLoanAccountStatusParameters statusParams = new EditLoanAccountStatusParameters();
statusParams.setNote("GLIM test");
statusParams.setStatus(EditLoanAccountStatusParameters.APPROVED);
loanAccountPage.changeAccountStatus(statusParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
String loanId = loanAccountPage.getAccountId();
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setAmount("209997.0");
disburseParams.setDisbursalDateDD("8");
disburseParams.setDisbursalDateMM("3");
disburseParams.setDisbursalDateYYYY("2011");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage.disburseLoan(disburseParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
PaymentParameters paymentParams = new PaymentParameters();
paymentParams.setAmount("1500.0");
paymentParams.setTransactionDateDD("8");
paymentParams.setTransactionDateMM("3");
paymentParams.setTransactionDateYYYY("2011");
paymentParams.setPaymentType(PaymentParameters.CASH);
loanTestHelper.applyPayment(loanId, paymentParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmit("1500.0");
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
String[] expectedPrincipalAmounts = new String[] { "24.9", "249.2", "249.3" };
String[] expectedInterestAmounts = new String[] { "46", "460.3", "460.3" };
String[] expectedFeeAmounts = new String[] { "0.5", "4.8", "4.7" };
verifyProRatedGLIMPayments(loanAccountPage, 3, expectedPrincipalAmounts, expectedInterestAmounts, expectedFeeAmounts);
loanTestHelper.repayLoan(loanId);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
loanAccountPage.navigateToApplyAdjustment().submitAdjustment();
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
statusParams.setNote("GLIM test");
statusParams.setStatus(EditLoanAccountStatusParameters.CLOSED_WRITTEN_OFF);
loanAccountPage.changeAccountStatus(statusParams);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
}
Aggregations