use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class LoanProcessWithDifferentCurrencyTest method createLoanAccountOfDifferentCurrency.
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException" })
private // one of the dependent methods throws Exception
String createLoanAccountOfDifferentCurrency(String clientName) throws Exception {
loanTestHelper = new LoanTestHelper(selenium);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString(clientName);
searchParameters.setLoanProduct("Loan With Different Currency");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012");
String fee = "USDfeeAdditional";
submitAccountParameters.setAdditionalFee1(fee);
return createLoanAndCheckAmount(searchParameters, submitAccountParameters);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateGroupLoanAccountTest method newMonthlyGroupLoanAccountWithMeetingOnSpecificDayOfMonth.
@Test(enabled = true)
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException" })
public void newMonthlyGroupLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2010, 8, 13, 1, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
homePage = loginSuccessfully();
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("MonthlyGroup");
searchParameters.setLoanProduct("MonthlyGroupFlatLoan1stOfMonth");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1000.0");
ClientsAndAccountsHomepage clientsAndAccountsPage = homePage.navigateToClientsAndAccountsUsingHeaderTab();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsPage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(searchParameters);
createLoanAccountEntryPage.verifyPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountEntryPage.submitAndNavigateToLoanAccountConfirmationPage(submitAccountParameters);
createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters 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)");
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateClientLoanAccountTest method createDecliningBalanceIRLoanWithFees.
public void createDecliningBalanceIRLoanWithFees() throws SQLException {
int interestRate = 25;
int loanAmount = 120;
int numberOfInstallments = 6;
feeTestHelper.createNoRateFee("fixedFee5629", FeesCreatePage.SubmitFormParameters.LOAN, "Upfront", 5);
feeTestHelper.createPeriodicRateFee("periodicFee5629", FeesCreatePage.SubmitFormParameters.LOAN, FeesCreatePage.SubmitFormParameters.WEEKLY_FEE_RECURRENCE, 1, 4, FeesCreatePage.SubmitFormParameters.LOAN_AMOUNT_INTEREST);
SubmitFormParameters dbIrLoanProductParams = loanProductTestHelper.defineLoanProductParameters(numberOfInstallments, loanAmount, interestRate, DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION, WEEKLY_RECURRENCE_TYPE_ID);
dbIrLoanProductParams.setOfferingName("DbIrProduct5629");
loanProductTestHelper.defineNewLoanProduct(dbIrLoanProductParams);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client1233266063395");
searchParameters.setLoanProduct("DbIrProduct5629");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAdditionalFee1("periodicFee5629");
submitAccountParameters.setAdditionalFee2("fixedFee5629");
ViewRepaymentSchedulePage schedulePage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
String[] expectedInterestAmounts = { "0.6", "0.5", "0.4", "0.3", "0.2", "0.7" };
String[] expectedFeeAmounts = { "9.9", "4.9", "4.9", "4.9", "4.9", "4.8" };
for (int i = 0; i < numberOfInstallments; i++) {
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.INTEREST_COLUMN, expectedInterestAmounts[i]);
schedulePage.verifyInstallmentAmount(ViewRepaymentSchedulePage.FIRST_ROW + i, ViewRepaymentSchedulePage.FEE_COLUMN, expectedFeeAmounts[i]);
}
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.
@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
String questionGroupTitle = "QG1" + random.nextInt(100);
String question1 = "DT_" + random.nextInt(100);
String question2 = "SS_" + random.nextInt(100);
String answer = "01/01/2010";
String choiceAnswer = "Choice2";
questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("client1 lastname");
searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1012.0");
QuestionResponseParameters parameters = new QuestionResponseParameters();
parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
questionResponseDetailPage.verifyPage();
questionResponseDetailPage.verifyQuestionPresent(question1, answer);
questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
questionResponseDetailPage.navigateToDetailsPage();
questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Aggregations