Search in sources :

Example 1 with CreateQuestionParameters

use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.

the class ClientTest method createQuestions2.

private void createQuestions2() {
    List<CreateQuestionParameters> questions = new ArrayList<CreateQuestionParameters>();
    CreateQuestionParameters q1 = new CreateQuestionParameters();
    q1.setType(CreateQuestionParameters.TYPE_DATE);
    q1.setText(question1);
    questions.add(q1);
    CreateQuestionParameters q2 = new CreateQuestionParameters();
    q2.setType(CreateQuestionParameters.TYPE_MULTI_SELECT);
    q2.setText(question2);
    q2.setChoicesFromStrings(Arrays.asList(new String[] { "first", "second" }));
    questions.add(q2);
    CreateQuestionParameters q3 = new CreateQuestionParameters();
    q3.setType(CreateQuestionParameters.TYPE_NUMBER);
    q3.setText(question3);
    q3.setNumericMax(10);
    q3.setNumericMin(0);
    questions.add(q3);
    CreateQuestionParameters q4 = new CreateQuestionParameters();
    q4.setType(CreateQuestionParameters.TYPE_NUMBER);
    q4.setText(question4);
    q4.setNumericMax(10);
    q4.setNumericMin(0);
    questions.add(q4);
    CreateQuestionParameters q5 = new CreateQuestionParameters();
    q5.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q5.setText(question5);
    questions.add(q5);
    CreateQuestionParameters q6 = new CreateQuestionParameters();
    q6.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q6.setText(question6);
    q6.setChoicesFromStrings(asList("good", "wrong"));
    questions.add(q6);
    CreateQuestionParameters q7 = new CreateQuestionParameters();
    q7.setType(CreateQuestionParameters.TYPE_DATE);
    q7.setText(question7);
    questions.add(q7);
    CreateQuestionParameters q8 = new CreateQuestionParameters();
    q8.setType(CreateQuestionParameters.TYPE_MULTI_SELECT);
    q8.setText(question8);
    q8.setChoicesFromStrings(Arrays.asList(new String[] { "jan", "feb" }));
    questions.add(q8);
    CreateQuestionParameters q9 = new CreateQuestionParameters();
    q9.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q9.setText(question9);
    questions.add(q9);
    CreateQuestionParameters q10 = new CreateQuestionParameters();
    q10.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q10.setText(question10);
    q10.setChoicesFromStrings(Arrays.asList(new String[] { "1", "2", "3" }));
    questions.add(q10);
    CreateQuestionParameters q11 = new CreateQuestionParameters();
    q11.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q11.setText(question11);
    questions.add(q11);
    questionGroupTestHelper.createQuestions(questions);
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) ArrayList(java.util.ArrayList)

Example 2 with CreateQuestionParameters

use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.

the class CenterTest method newFreeTextQuestionParameters.

private CreateQuestionParameters newFreeTextQuestionParameters(String text) {
    CreateQuestionParameters questionParams = new CreateQuestionParameters();
    questionParams.setText(text);
    questionParams.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    return questionParams;
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)

Example 3 with CreateQuestionParameters

use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.

the class CenterTest method createQuestions.

private void createQuestions() {
    List<CreateQuestionParameters> questions = new ArrayList<CreateQuestionParameters>();
    CreateQuestionParameters q1 = new CreateQuestionParameters();
    q1.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q1.setText("center question 1");
    q1.setChoicesFromStrings(Arrays.asList(new String[] { "yes", "no" }));
    questions.add(q1);
    CreateQuestionParameters q2 = new CreateQuestionParameters();
    q2.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q2.setText("center question 2");
    q2.setChoicesFromStrings(Arrays.asList(new String[] { "good", "bad", "average" }));
    questions.add(q2);
    CreateQuestionParameters q3 = new CreateQuestionParameters();
    q3.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q3.setText("center question 3");
    questions.add(q3);
    CreateQuestionParameters q4 = new CreateQuestionParameters();
    q4.setType(CreateQuestionParameters.TYPE_DATE);
    q4.setText("center question 4");
    questions.add(q4);
    CreateQuestionParameters q5 = new CreateQuestionParameters();
    q5.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q5.setText("center question 5");
    questions.add(q5);
    CreateQuestionParameters q6 = new CreateQuestionParameters();
    q6.setType(CreateQuestionParameters.TYPE_NUMBER);
    q6.setText("center question 6");
    q6.setNumericMax(10);
    q6.setNumericMin(0);
    questions.add(q6);
    questionTestHelper.createQuestions(questions);
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) ArrayList(java.util.ArrayList)

Example 4 with CreateQuestionParameters

use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters 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");
}
Also used : HashMap(java.util.HashMap) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) Test(org.testng.annotations.Test)

Example 5 with CreateQuestionParameters

use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.

the class PersonnelTest method createQuestions.

private void createQuestions() {
    List<CreateQuestionParameters> questions = new ArrayList<CreateQuestionParameters>();
    CreateQuestionParameters q1 = new CreateQuestionParameters();
    q1.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q1.setText("user question 1");
    q1.setChoicesFromStrings(Arrays.asList(new String[] { "yes", "no" }));
    questions.add(q1);
    CreateQuestionParameters q2 = new CreateQuestionParameters();
    q2.setType(CreateQuestionParameters.TYPE_SINGLE_SELECT);
    q2.setText("user question 2");
    q2.setChoicesFromStrings(Arrays.asList(new String[] { "good", "bad", "average" }));
    questions.add(q2);
    CreateQuestionParameters q3 = new CreateQuestionParameters();
    q3.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q3.setText("user question 3");
    questions.add(q3);
    CreateQuestionParameters q4 = new CreateQuestionParameters();
    q4.setType(CreateQuestionParameters.TYPE_DATE);
    q4.setText("user question 4");
    questions.add(q4);
    CreateQuestionParameters q5 = new CreateQuestionParameters();
    q5.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    q5.setText("user question 5");
    questions.add(q5);
    CreateQuestionParameters q6 = new CreateQuestionParameters();
    q6.setType(CreateQuestionParameters.TYPE_NUMBER);
    q6.setText("user question 6");
    q6.setNumericMax(10);
    q6.setNumericMin(0);
    questions.add(q6);
    questionGroupTestHelper.createQuestions(questions);
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) ArrayList(java.util.ArrayList)

Aggregations

CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)26 ArrayList (java.util.ArrayList)13 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)7 Test (org.testng.annotations.Test)7 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)6 HashMap (java.util.HashMap)5 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)4 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)4 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)3 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)3 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)3 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)3 Choice (org.mifos.test.acceptance.framework.questionnaire.Choice)2 QuestionGroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper)2 DateTime (org.joda.time.DateTime)1 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)1 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)1 CenterViewDetailsPage (org.mifos.test.acceptance.framework.center.CenterViewDetailsPage)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1