use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.
the class QuestionGroupLoanAccountTest method verifyResponsesDuringLoanAccountApproval.
/**
* Capturing responses while approving Loan account
* http://mifosforge.jira.com/browse/MIFOSTEST-684
*
* @throws Exception
*/
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringLoanAccountApproval() throws Exception {
questionGroupTestHelper.markQuestionGroupAsActive("QGForApproveLoan1");
questionGroupTestHelper.markQuestionGroupAsActive("QGForApproveLoan2");
try {
CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_APPROVED);
editAccountStatusParameters.setNote("note note");
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].valuesAsArray", "three");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
createQuestionParameters.setText("questionByVerifyResponsesDuringLoanAccountApproval");
List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
newQuestionList.add(createQuestionParameters);
String[] questionsExist = { "Date", "FreeText", "SingleSelect", "questionByVerifyResponsesDuringLoanAccountApproval" };
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");
LoanAccountPage loanAccountPage = loanTestHelper.createDefaultLoanAccount(createLoanAccountSearchParameters);
String loanID1 = loanAccountPage.getAccountId();
loanAccountPage = loanTestHelper.createDefaultLoanAccount(createLoanAccountSearchParameters);
String loanID2 = loanAccountPage.getAccountId();
QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID1, editAccountStatusParameters);
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage = questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().navigateToEditStatus().submitAndNavigateToQuestionResponsePage(editAccountStatusParameters);
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().submitAndNavigateToLoanAccountPage();
questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan2");
questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForApproveLoan1", newQuestionList);
questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID2, editAccountStatusParameters);
questionResponsePage.verifyQuestionsExists(questionsExist);
questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
verifyQuestionResponsesExistInDatabase(loanID1, "Approve Loan", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan1");
questionGroupTestHelper.markQuestionGroupAsInactive("QGForApproveLoan2");
}
}
use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.
the class QuestionGroupLoanAccountTest method verifyResponsesDuringLoanAccountClosing.
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringLoanAccountClosing() throws Exception {
questionGroupTestHelper.markQuestionGroupAsActive("QGForCloseLoan");
try {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu12332659912419 Client12332659912419");
searchParams.setLoanProduct(productParams.getOfferingName());
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
disburseParams.setDisbursalDateDD("24");
disburseParams.setDisbursalDateMM("02");
disburseParams.setDisbursalDateYYYY("2011");
loanProductTestHelper.defineNewLoanProduct(productParams);
LoanAccountPage loanAccountPage = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams);
String loanID1 = loanAccountPage.getAccountId();
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");
String[] questionsExist = { "Date", "FreeText" };
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("Date", "04/02/2011");
questionsAndAnswers.put("FreeText", "free text");
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.LOAN_CLOSED_WRITTENOFF);
editAccountStatusParameters.setNote("note note");
QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanStatusChange(loanID1, editAccountStatusParameters);
questionResponsePage.verifyQuestionsExists(questionsExist);
questionResponsePage.populateAnswers(questionResponseParameters);
questionResponsePage.continueAndNavigateToEditAccountStatusConfirmationPage().submitAndNavigateToLoanAccountPage();
verifyQuestionResponsesExistInDatabase(loanID1, "Close Loan", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCloseLoan");
}
}
use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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();
}
use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.
the class CreateSavingsAccountTest method verifyPaymentTypesForWithdrawalsAndDeposits.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(singleThreaded = true, groups = { "savings", "acceptance", "ui", "no_db_unit" })
public void verifyPaymentTypesForWithdrawalsAndDeposits() throws Exception {
//When
NavigationHelper navigationHelper = new NavigationHelper(selenium);
AdminPage adminPage = navigationHelper.navigateToAdminPage();
DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.CHEQUE);
adminPage = navigationHelper.navigateToAdminPage();
defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addSavingsWithdrawalsType(defineAcceptedPaymentTypesPage.VOUCHER);
adminPage = navigationHelper.navigateToAdminPage();
defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
adminPage = navigationHelper.navigateToAdminPage();
defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
defineAcceptedPaymentTypesPage.addSavingsDepositsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString("Client - Mary Monthly");
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("248.0");
SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.createSavingsAccountWithQG(searchParameters, submitAccountParameters);
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("test");
savingsAccountDetailPage = savingsAccountHelper.changeStatus(savingsAccountDetailPage.getAccountId(), editAccountStatusParameters);
SavingsDepositWithdrawalPage savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
//Then
savingsDepositWithdrawalPage.verifyModeOfPayments();
//When
savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
//Then
savingsDepositWithdrawalPage.verifyModeOfPayments();
//When
savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000002");
savingsDepositWithdrawalPage = savingsAccountDetailPage.navigateToDepositWithdrawalPage();
savingsDepositWithdrawalPage.selectPaymentType(DepositWithdrawalSavingsParameters.DEPOSIT);
//Then
savingsDepositWithdrawalPage.verifyModeOfPayments();
}
use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.
the class AdditionalSavingsAccountTest method createSavingsAccount.
private String createSavingsAccount(SavingsProductParameters params) {
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
confirmationPage.navigateToSavingsProductDetails();
SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233266299995 Client1233266299995", params.getProductInstanceName(), "100000.0");
String savingsId = savingsAccountDetailPage.getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
return savingsId;
}
Aggregations