use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters 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.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateLSIMClientLoanAccountTest method createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay.
// http://mifosforge.jira.com/browse/MIFOSTEST-121
@Test(enabled = true)
public void createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay() throws Exception {
//Given
setTime(2011, 02, 23);
//When
DefineNewLoanProductPage.SubmitFormParameters defineNewLoanProductformParameters = FormParametersHelper.getWeeklyLoanProductParameters();
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
searchParameters.setLoanProduct(defineNewLoanProductformParameters.getOfferingName());
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters = createSearchParameters("23", "02", "2011");
submitAccountParameters.setLoanPurpose("0008-Animal Trading");
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(AccountStatus.LOAN_APPROVED.getStatusText());
editLoanAccountStatusParameters.setNote("activate account");
DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
disburseLoanParameters = createDisubreseLoanParameters("24", "02", "2011");
loanProductTestHelper.defineNewLoanProduct(defineNewLoanProductformParameters);
String loanId = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId();
loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
//Then
loanTestHelper.disburseLoanWithWrongParams(loanId, disburseLoanParameters, "Date of transaction can not be a future date.");
disburseLoanParameters.setDisbursalDateDD("23");
loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
//loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
loanTestHelper.repayLoan(loanId);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateLSIMClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@Test(enabled = true)
public void newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Client - Mary Monthly1");
searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
expectedDate = "05-Feb-2010";
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1234.0");
submitAccountParameters.setLoanPurpose("0008-Animal Trading");
// create LSIM loan that has repayments on 5th of every month
submitAccountParameters.setLsimFrequencyMonths("on");
submitAccountParameters.setLsimMonthTypeDayOfMonth("on");
submitAccountParameters.setLsimDayOfMonth("5");
submitAccountParameters.setLoanPurpose("0010-Camel");
createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateLSIMClientLoanAccountTest method newWeeklyLSIMClientLoanAccount.
@Test(enabled = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-127
void newWeeklyLSIMClientLoanAccount() throws Exception {
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
searchParameters.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
expectedDate = "29-Jan-2010";
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("9012.0");
submitAccountParameters.setLsimFrequencyWeeks("on");
submitAccountParameters.setLsimWeekFrequency("1");
submitAccountParameters.setLsimWeekDay("Friday");
submitAccountParameters.setLoanPurpose("0008-Animal Trading");
createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
use of org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters in project head by mifos.
the class CreateClientLoanAccountTest method approveLoanAmountByDifferentLoanAmountRangesTest.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOSTEST-1185
@Test(enabled = true)
public void approveLoanAmountByDifferentLoanAmountRangesTest() throws Exception {
// When
ManageRolePage manageRolePage = new ManageRolePage(selenium);
//.
manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
manageRolePage.enablePermission("activityRestrictionCheckbox1");
manageRolePage.typeText("restrictionValue(1)", "asdf");
manageRolePage.verifyAmountTextField();
manageRolePage.typeText("restrictionValue(1)", "5,000");
manageRolePage.enablePermission("activityRestrictionCheckbox1");
manageRolePage.submitAndGotoViewRolesPage();
//Then
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
searchParameters.setSearchString("ClientWithLoan 20110221");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("6000");
LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
String loanAccountId = loanAccountPage.getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
editAccountStatusParameters.setNote("Approve test");
loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters);
loanAccountPage.verifyLoanAmountPermissionError();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PARTIAL);
searchParameters.setSearchString(loanAccountId);
loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
//When
manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
manageRolePage.disablePermission("activityRestrictionCheckbox1");
manageRolePage.typeText("restrictionValue(1)", "");
manageRolePage.submitAndGotoViewRolesPage();
//Then
loanAccountPage = loanTestHelper.navigateToLoanAccountPage(searchParameters);
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_PENDING_APPROVAL);
loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
loanAccountPage.navigateToEditAccountStatus().setChangeStatusParametersAndSubmit(editAccountStatusParameters).submitAndNavigateToLoanAccountPage();
}
Aggregations