use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class CreateLSIMClientLoanAccountTest method createLoanAccountWithNonMeetingDatesForDisburseAndRepay.
// http://mifosforge.jira.com/browse/MIFOSTEST-123
@Test(enabled = true)
public void createLoanAccountWithNonMeetingDatesForDisburseAndRepay() throws Exception {
//Given
setTime(2011, 03, 24);
String errorMessage = "";
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setLoanProduct("ClientEmergencyLoan");
formParameters.setSearchString("UpdateCustomProperties TestClient");
for (int i = 0; i < 2; i++) {
CreateLoanAccountSearchPage createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("1");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
errorMessage = "No text <Stu12332659912419 Client12332659912419:ID0002-000000030> present on the page";
createLoanAccountSearchPage.verifyTextPresent("Stu12332659912419 Client12332659912419:ID0002-000000030", errorMessage);
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString(" ");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
errorMessage = "No text <Stu1233266063395 Client1233266063395:ID0002-000000003> present on the page";
createLoanAccountSearchPage.verifyTextPresent("Stu1233266063395 Client1233266063395:ID0002-000000003", errorMessage);
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("%");
createLoanAccountSearchPage = createLoanAccountSearchPage.navigateToCreateLoanAccountEntryPage(formParameters);
createLoanAccountSearchPage.waitForElementToPresent("name=customerSearchResults_length");
verify10SearchResults();
verify25SearchResults();
verify50SearchResults();
verify100SearchResults();
formParameters.setSearchString("UpdateCustomProperties TestClient");
navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu().verifyNoSelectLoanProduct(formParameters, "Please select a Loan product name");
createLoanAccountSearchPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu();
formParameters.setSearchString("UpdateCustomProperties TestClient");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu().searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.verifyAllowedAmounts("1,000", "10,000", "1000.0");
createLoanAccountEntryPage.verifyDisbsursalDate("25", "3", "2011");
createLoanAccountEntryPage.setAmount("");
createLoanAccountEntryPage.setInstallments("");
createLoanAccountEntryPage.setDisbursalDate("", "", "");
createLoanAccountEntryPage.setInterestRate("");
createLoanAccountEntryPage.setLonaPurpose("0008-Animal Trading");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("Please specify valid Amount. Amount should be a value between 1,000 and 10,000, inclusive.");
createLoanAccountEntryPage.verifyError("Please specify valid Interest rate. Interest rate should be a value between 0 and 0, inclusive.");
createLoanAccountEntryPage.verifyError("Please specify valid No. of installments. No. of installments should be a value between 1 and 10, inclusive.");
createLoanAccountEntryPage.verifyError("You have entered an invalid disbursal date. Please check the date format.");
createLoanAccountEntryPage.setDisbursalDate("26", "02", "2011");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The disbursement date is invalid. Disbursement date must be on or after todays date.");
createLoanAccountEntryPage.setDisbursalDate("21", "01", "2012");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
if (i % 2 == 0) {
createLoanAccountEntryPage.verifyNoError("The disbursement date is invalid. It must fall on a valid customer meeting schedule.");
} else {
createLoanAccountEntryPage.verifyError("The disbursement date is invalid. It must fall on a valid customer meeting schedule.");
}
createLoanAccountEntryPage.setDisbursalDate("25", "3", "2011");
createLoanAccountEntryPage.setAmount("999999999999999999.88888888");
createLoanAccountEntryPage.setInterestRate("999999999999.88888888");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The interest rate is invalid as the number of digits after the decimal separator exceeds the allowed number of 5.");
createLoanAccountEntryPage.verifyError("The amount is invalid because the number of digits before the decimal separator exceeds the allowed number of 14.");
createLoanAccountEntryPage.setAmount("12345678901234");
createLoanAccountEntryPage.setInterestRate("999999999999.88888888");
createLoanAccountEntryPage = createLoanAccountEntryPage.clickContinueButExpectValidationFailure();
createLoanAccountEntryPage.verifyError("The interest rate is invalid as the number of digits after the decimal separator exceeds the allowed number of 5.");
CreateLoanAccountSubmitParameters formParametersFees = new CreateLoanAccountSubmitParameters();
formParametersFees.setAdditionalFee1("loanWeeklyFee");
formParametersFees.setAdditionalFee2("oneTimeFee");
createLoanAccountEntryPage.setAmount("5000");
createLoanAccountEntryPage.setInterestRate("0.0");
createLoanAccountEntryPage.setInstallments("10");
createLoanAccountEntryPage.fillAdditionalFee(formParametersFees);
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.clickContinue();
createLoanAccountReviewInstallmentPage.verifyLoanAmount("5,000");
createLoanAccountReviewInstallmentPage.verifyDueDate(1, "01/04/11");
createLoanAccountReviewInstallmentPage.verifyDueDate(2, "08/04/11");
createLoanAccountReviewInstallmentPage.verifyDueDate(10, "03/06/11");
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndNavigateToPreviewPage();
createLoanAccountPreviewPage.verifyLoanAmount("5,000");
createLoanAccountPreviewPage.verifyInterestTypeInLoanPreview("Flat");
createLoanAccountPreviewPage.verifyDueDate(1, "01-Apr-2011");
createLoanAccountPreviewPage.verifyDueDate(2, "08-Apr-2011");
createLoanAccountPreviewPage.verifyDueDate(10, "03-Jun-2011");
createLoanAccountEntryPage = createLoanAccountPreviewPage.editAccountInformation();
createLoanAccountEntryPage.setAmount("2000.0");
createLoanAccountPreviewPage = createLoanAccountEntryPage.clickContinue().clickPreviewAndNavigateToPreviewPage();
createLoanAccountPreviewPage.verifyLoanAmount("2,000");
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
errorMessage = "No text <View loan account details now> present on the page";
createLoanAccountConfirmationPage.verifyTextPresent("View loan account details now", errorMessage);
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
loanAccountPage.verifyStatus("Application Pending Approval");
loanAccountPage.verifyDisbursalDate("25/03/2011");
String[][] accountSummaryTable = { { "", "Original Loan", "Amount paid", "Loan balance" }, { "Principal", "2,000", "0", "2,000" }, { "Interest", "0", "0", "0" }, { "Fees", "1,010", "0", "1,010" }, { "Penalty", "0", "0", "0" }, { "Total", "3,010", "0", "3,010" } };
loanAccountPage.verifyAccountSummary(accountSummaryTable);
loanAccountPage.verifyInterestRate("0");
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "01-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "08-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "22-Apr-2011");
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
editLoanAccountInformationPage.setAmount("3000.0");
loanAccountPage = editLoanAccountInformationPage.submitAndNavigateToAccountInformationPreviewPage().submitAndNavigateToLoanAccountPage();
loanAccountPage.verifyLoanAmount("3000.0");
applicationDatabaseOperation.updateLSIM(0);
}
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class LoanProcessWithDifferentCurrencyTest method createLoanAndCheckAmount.
private String createLoanAndCheckAmount(CreateLoanAccountSearchParameters searchParameters, CreateLoanAccountSubmitParameters submitAccountParameters) {
LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
loanAccountPage.verifyLoanAmount(submitAccountParameters.getAmount());
return loanAccountPage.getAccountId();
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ProperLoanProductCalculationsTest method verifyInterestCalculatedWith365Days.
/**
* Verify the interest should be calculated with 365 days as the base.
* http://mifosforge.jira.com/browse/MIFOSTEST-199
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyInterestCalculatedWith365Days() throws Exception {
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("000100000000052");
LoanAccountPage loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParams);
loanAccountPage.verifyPrincipalOriginal("10,000");
loanAccountPage.verifyInterestOriginal("461");
loanAccountPage.verifyFeesOriginal("0");
loanAccountPage.verifyPenaltyOriginal("0");
loanAccountPage.verifyTotalOriginalLoan("10461.0");
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage in project head by mifos.
the class ProperLoanProductCalculationsTest method verifyProperInterestAndPaymentMonthlyFlatProduct.
/**
* Flat interest rate monthly loan calculates and displays proper interest and payment information.
* http://mifosforge.jira.com/browse/MIFOSTEST-64
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProperInterestAndPaymentMonthlyFlatProduct() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getMonthlyLoanProductParameters();
String productName = "LoanProduct" + StringUtil.getRandomString(5);
productParams.setOfferingName(productName);
productParams.setOfferingShortName(StringUtil.getRandomString(4));
productParams.setDefaultInterestRate("23");
productParams.setMaxInterestRate("50");
productParams.setInterestTypes(SubmitFormParameters.FLAT);
productParams.setDefaultLoanAmount("17231");
productParams.setDefInstallments("23");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Client - Mary Monthly");
searchParams.setLoanProduct(productName);
loanProductTestHelper.defineNewLoanProduct(productParams);
LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
loanAccountPage.verifyPrincipalOriginal("17,231");
loanAccountPage.verifyInterestOriginal("7,596");
loanAccountPage.verifyFeesOriginal("0");
loanAccountPage.verifyPenaltyOriginal("0");
loanAccountPage.verifyTotalOriginalLoan("24827.0");
}
use of org.mifos.test.acceptance.framework.loan.LoanAccountPage 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"));
}
Aggregations