use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters 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);
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class ClientLoanStatusChangeTest method pendingApprovalToApplicationApprovedWithQuestionGroup.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void pendingApprovalToApplicationApprovedWithQuestionGroup() throws Exception {
String qgForLoanApproval = "QGForLoanApproval";
QuestionGroupTestHelper questionGroupTestHelper = new QuestionGroupTestHelper(selenium);
questionGroupTestHelper.markQuestionGroupAsActive(qgForLoanApproval);
EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
statusParameters.setNote("Test");
QuestionResponseParameters responseParameters = new QuestionResponseParameters();
responseParameters.addTextAnswer("create_ClientPersonalInfo.input.customField", "testResponse");
loanTestHelper.changeLoanAccountStatusProvidingQuestionGroupResponses("000100000000055", statusParameters, responseParameters);
questionGroupTestHelper.markQuestionGroupAsInactive(qgForLoanApproval);
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class ClientTest method createClientWithQuestionGroups.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// http://mifosforge.jira.com/browse/MIFOSTEST-681
@Test(enabled = true)
public void createClientWithQuestionGroups() throws Exception {
createQuestions();
CreateQuestionGroupParameters qg = questionGroupTestHelper.getCreateQuestionGroupParameters("CreateClientQG", asList("q1", "q2", "q3"), "Create Client", "Sec 1");
questionGroupTestHelper.createQuestionGroup(qg);
CreateQuestionGroupParameters qg2 = questionGroupTestHelper.getCreateQuestionGroupParameters("CreateClientQG2", asList("q6"), "Create Client", "Sec 2");
questionGroupTestHelper.createQuestionGroup(qg2);
CreateClientEnterPersonalDataPage.SubmitFormParameters formParameters = createFormParameters();
QuestionResponseParameters responseParams = new QuestionResponseParameters();
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "yes");
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "good");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "qwer");
// When
clientTestHelper.createClientWithQuestionGroups(formParameters, "group1", responseParams);
List<String> questionToAdd = new ArrayList<String>();
questionToAdd.add("q4");
questionToAdd.add("q5");
List<String> questionToDeactivate = new ArrayList<String>();
questionToDeactivate.add("q6");
CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
for (String question : questionToAdd) {
createQuestionGroupParameters.addExistingQuestion("Sec 1", question);
}
questionGroupTestHelper.addQuestionsToQuestionGroup("CreateClientQG", createQuestionGroupParameters.getExistingQuestions());
for (String question : questionToDeactivate) {
questionGroupTestHelper.markQuestionAsInactive(question);
}
questionGroupTestHelper.markQuestionGroupAsInactive("CreateClientQG2");
QuestionResponsePage questionResponsePage = clientTestHelper.navigateToQuestionResponsePage(formParameters, "group1");
// Then
questionResponsePage.verifyQuestionsDoesnotappear(questionToDeactivate.toArray(new String[questionToDeactivate.size()]));
questionResponsePage.verifyQuestionsExists(questionToAdd.toArray(new String[questionToAdd.size()]));
questionResponsePage.verifySectionDoesnotappear("Sec 2");
questionGroupTestHelper.markQuestionGroupAsInactive("CreateClientQG");
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class CenterTest method getQuestionResponseParameters.
private QuestionResponseParameters getQuestionResponseParameters(String answer) {
QuestionResponseParameters responseParams = new QuestionResponseParameters();
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "yes");
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "good");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", answer);
return responseParams;
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class QuestionGroupSavingsAccountTest method verifyCapturingResponsesDuringSavingsCreation.
//http://mifosforge.jira.com/browse/MIFOSTEST-669
/*
* need to fix up commonality between questionaire pages for loan and savings.
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void verifyCapturingResponsesDuringSavingsCreation() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 28, 15, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
setQuestionGroup();
createClient("669");
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString("Joe669 Doe669");
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("248.0");
QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textquestion");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "100");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[2].value", "Text");
questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[0].questions[3].value", "blue");
questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].values", "two");
questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "6");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].values", "one");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "123");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "7");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "Text");
questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "red");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[2].questions[0].value", "Text");
QuestionResponseParameters questionResponseParameters2 = new QuestionResponseParameters();
questionResponseParameters2.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textQuestion");
questionResponseParameters2.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "9");
savingsAccountHelper.fillQuestionGroupsDurringCreationSavingsAccount(searchParameters, submitAccountParameters, questionResponseParameters);
SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.editAdditionalInformationDurringCreationSavingsAccount(questionResponseParameters2);
String savingsId = savingsAccountDetailPage.getAccountId();
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount");
questionGroupTestHelper.markQuestionAsInactive("SingleSelect");
questionGroupTestHelper.markQuestionAsInactive("NumberBetween5And10");
questionGroupTestHelper.markQuestionAsInactive("Question1");
questionGroupTestHelper.markQuestionAsInactive("question 1");
CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
createQuestionParameters.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
createQuestionParameters.setText("newQuestion232");
List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
newQuestionList.add(createQuestionParameters);
questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateSavingsAccount2", newQuestionList);
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("MultiSelect", "two");
questionsAndAnswers.put("Number", "100");
questionsAndAnswers.put("FreeText", "textquestion");
String[] questionsExist = { "newQuestion232", "MultiSelect", "Number", "FreeText" };
String[] questionsInactive = { "SingleSelect", "NumberBetween5And10", "Question1", "question 1", "Date" };
QuestionnairePage questionnairePage = savingsAccountHelper.navigateToQuestionResponseDuringCreateSavings(searchParameters, submitAccountParameters);
questionnairePage.verifyQuestionsExists(questionsExist);
questionnairePage.verifyQuestionsDoesnotappear(questionsInactive);
verifyQuestionResponsesExistInDatabase(savingsId, "Create Savings", questionsAndAnswers);
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount2");
questionGroupTestHelper.markQuestionAsActive("SingleSelect");
questionGroupTestHelper.markQuestionAsActive("NumberBetween5And10");
questionGroupTestHelper.markQuestionAsActive("Question1");
questionGroupTestHelper.markQuestionAsActive("question 1");
}
Aggregations