use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage in project head by mifos.
the class CreateGLIMLoanAccountTest method checkGLIMAccountEmptyPurpose.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMAccountEmptyPurpose() 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", "9999", "0012-Sheep Purchase");
loanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999");
loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999");
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String[] purposes = { "0012-Sheep Purchase", "-", "-" };
loanAccountPage.verifyGLIMPurpose(purposes);
loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
EditPreviewLoanAccountPage previewLoanAccountPage = loanAccountPage.navigateToEditAccountInformation().submitAndNavigateToAccountInformationPreviewPage();
previewLoanAccountPage.verifyGLIMPurpose(purposes);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage in project head by mifos.
the class LoanTestHelper method createAndActivateDefaultLoanAccount.
public LoanAccountPage createAndActivateDefaultLoanAccount(CreateLoanAccountSearchParameters searchParams) {
CreateLoanAccountEntryPage createLoanAccountEntryPage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateLoanAccountUsingLeftMenu().searchAndNavigateToCreateLoanAccountPage(searchParams);
createLoanAccountEntryPage.setLonaPurpose("0013-Hybrid Cow");
Double loanAmountDouble = Double.valueOf(createLoanAccountEntryPage.getLoanAmount());
String loanAmount = new NumberFormatter().print(loanAmountDouble, Locale.ENGLISH);
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.clickContinue();
createLoanAccountReviewInstallmentPage = createLoanAccountReviewInstallmentPage.verifyPage();
createLoanAccountReviewInstallmentPage.verifyLoanAmount(loanAmount);
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
createLoanAccountPreviewPage.verifyLoanAmount(loanAmount);
return createLoanAccountPreviewPage.submit().navigateToLoanAccountDetailsPage().changeAccountStatusToAccepted();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage in project head by mifos.
the class CreateGLIMLoanAccountWithOneTimeFeeTest method createLoan.
private LoanAccountPage createLoan() {
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.setDisbursalDate(new DateTime(2011, 3, 4, 15, 0, 0, 0));
createLoanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "200", "0009-Horse");
createLoanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "300", "0001-Cow Purchase");
createLoanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "500", "0003-Goat Purchase");
createLoanAccountEntryPage.setInstallments("10");
createLoanAccountEntryPage.setInterestRate("21");
selenium.type("defaultFeeIndividualAmounts[0][0]", "0.2");
selenium.type("defaultFeeIndividualAmounts[0][1]", "0.3");
selenium.type("defaultFeeIndividualAmounts[0][2]", "0.5");
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
return createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage in project head by mifos.
the class QuestionGroupLoanAccountTest method verifyResponsesDuringCreationOfLoanAccount.
/**
* Capturing responses during the creation of Loan account
* http://mifosforge.jira.com/browse/MIFOSTEST-683
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringCreationOfLoanAccount() throws Exception {
CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
CreateLoanAccountSubmitParameters formParameters = new CreateLoanAccountSubmitParameters();
formParameters.setAdditionalFee1("oneTimeFee");
formParameters.setAdditionalFee2("loanWeeklyFee");
verifyQGNotDisplayed(createLoanAccountSearchParameters);
questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan1");
questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan2");
try {
QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "free text1");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "07/02/2011");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "20");
questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].values", "three");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
createQuestionParameters.setText("questionByVerifyResponsesDuringCreationOfLoanAccount");
List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
newQuestionList.add(createQuestionParameters);
String[] questionsExist = { "Date", "FreeText", "SingleSelect", "questionByVerifyResponsesDuringCreationOfLoanAccount" };
String[] questionsInactive = { "ToBeDisabled" };
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("MultiSelect", "three");
questionsAndAnswers.put("Number", "20");
questionsAndAnswers.put("Date", "04/02/2011");
QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, formParameters);
questionResponsePage.populateAnswers(questionResponseParameters);
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage();
verifyCreateLoanAccountPreviewPage();
questionResponsePage = createLoanAccountPreviewPage.navigateToQuestionResponsePage();
questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
questionResponsePage.populateAnswers(questionResponseParameters);
LoanAccountPage loanAccountPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
String loanID = loanAccountPage.getAccountId();
verifyFees();
ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
viewQuestionResponseDetailPage.verifyQuestionPresent("ToBeDisabled", "free text");
viewQuestionResponseDetailPage.verifyQuestionPresent("FreeText", "free text1");
viewQuestionResponseDetailPage.verifyQuestionPresent("SingleSelect", "blue");
viewQuestionResponseDetailPage.verifyQuestionPresent("DateQuestion", "07/02/2011");
viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
viewQuestionResponseDetailPage.verifyQuestionPresent("Text", "free text2");
questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateLoan1", newQuestionList);
questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, null);
questionResponsePage.verifyQuestionsExists(questionsExist);
questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
verifyQuestionResponsesExistInDatabase(loanID, "Create Loan", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan1");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
}
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage in project head by mifos.
the class CashFlowTest method verifyCashFlowPageInLoanAccountCreationFlow.
/**
* Disabled after work on daily interest calculation for variable installments. - keithw-
*
* Verify Cash Flow Page in Loan Account creation flow
* http://mifosforge.jira.com/browse/MIFOSTEST-672
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyCashFlowPageInLoanAccountCreationFlow() throws Exception {
applicationDatabaseOperation.updateLSIM(1);
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setDefInstallments("12");
productParams.setDefaultLoanAmount("2000");
CreateLoanAccountSearchParameters loanSearchParams = new CreateLoanAccountSearchParameters();
loanSearchParams.setSearchString(clientName);
loanSearchParams.setLoanProduct(productParams.getOfferingName());
DateTime disbursalDate = systemDateTime.plusDays(1);
loanProductTestHelper.navigateToDefineNewLoanPageAndFillMandatoryFields(productParams).fillCashFlow("", "49", "400").fillVariableInstalmentOption("", "1", "").submitAndGotoNewLoanProductPreviewPage().submit();
CreateLoanAccountCashFlowPage cashFlowPage = loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
cashFlowPage.verifyTableExist();
cashFlowPage.validateCashFlowMonths(disbursalDate, 12, DefineNewLoanProductPage.SubmitFormParameters.WEEKS);
cashFlowPage.cancel();
loanTestHelper.navigateToCreateLoanAccountCashFlowPage(loanSearchParams);
cashFlowPage.submitWithErrors();
cashFlowPage.verifyInvalidTextTyped();
cashFlowPage.verifyErrorsOnPage();
cashFlowPage.verifyMonths();
cashFlowPage.verifyErrorsOnFields();
cashFlowPage.enterValidData("1000", 1000, 100, "4000", "5000");
cashFlowPage = cashFlowPage.submitWithErrors();
cashFlowPage.verifyErrorsOnPage("Indebtedness rate of the client is 175 % which is greater than allowed value of 49 %.");
cashFlowPage.enterValidData("1000", 1000, 100, "5000", "400");
CreateLoanAccountReviewInstallmentPage reviewPage = cashFlowPage.clickContinue();
reviewPage.verifyCashFlow(100, 2000, new String[] { "100", "1858", "1445", "1716", "2334.7", "2600" }, new String[] { "0", "15.5", "37.2", "28.5", "6.6", "0" });
reviewPage = reviewPage.clickPreview();
reviewPage.verifyErrorsOnPage("Repayment Capacity of the client is 127.06 % which should be greater than the required value of 400.0 %");
cashFlowPage = reviewPage.editCashFlow();
cashFlowPage.enterValidData("1000", 1000, 1100, "5000", "400");
reviewPage = cashFlowPage.clickContinue();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = reviewPage.clickPreviewAndNavigateToPreviewPage();
createLoanAccountPreviewPage.verifyLoanAmount("2,000");
createLoanAccountPreviewPage.verifyInterestTypeInLoanPreview("Declining Balance");
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submit();
createLoanAccountConfirmationPage.isTextPresentInPage("View loan account details now");
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
loanAccountPage.verifyDisbursalDate("12/10/2010");
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
String[][] tableAfterLastInstallment = { { "Future Installments", "", "", "", "", "", "" }, { "1", "19-Oct-2010", "-", "163.7", "7.3", "0", "0", "0", "171" }, { "2", "26-Oct-2010", "-", "164.3", "6.7", "0", "0", "0", "171" }, { "3", "02-Nov-2010", "-", "165", "6", "0", "0", "0", "171" }, { "4", "09-Nov-2010", "-", "165.6", "5.4", "0", "0", "0", "171" }, { "5", "16-Nov-2010", "-", "166.2", "4.8", "0", "0", "0", "171" }, { "6", "23-Nov-2010", "-", "166.8", "4.2", "0", "0", "0", "171" }, { "7", "30-Nov-2010", "-", "167.5", "3.5", "0", "0", "0", "171" }, { "8", "07-Dec-2010", "-", "168.1", "2.9", "0", "0", "0", "171" }, { "9", "14-Dec-2010", "-", "168.7", "2.3", "0", "0", "0", "171" }, { "10", "21-Dec-2010", "-", "169.3", "1.7", "0", "0", "0", "171" }, { "11", "28-Dec-2010", "-", "169.9", "1.1", "0", "0", "0", "171" }, { "12", "04-Jan-2011", "-", "164.9", "0.4", "0", "0", "0", "165.3" } };
viewRepaymentSchedulePage.verifyScheduleTable(tableAfterLastInstallment);
loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountInformationPage editLoanAccountInformationPage = loanAccountPage.navigateToEditAccountInformation();
editLoanAccountInformationPage.verifyInstallments("12");
editLoanAccountInformationPage.verifyInterestRate("19");
editLoanAccountInformationPage.verifyDisbursalDate("12", "10", "2010");
editLoanAccountInformationPage.verifyLoanAmount("2000.0");
applicationDatabaseOperation.updateLSIM(0);
}
Aggregations