use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.
the class ClientTest method getCreateQuestionParams.
private CreateQuestionParameters getCreateQuestionParams(String title, String type, List<String> choices) {
CreateQuestionParameters parameters = new CreateQuestionParameters();
parameters.setText(title);
parameters.setType(type);
parameters.setChoicesFromStrings(choices);
return parameters;
}
use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.
the class ClientTest method closeClientAccountWithQG.
// http://mifosforge.jira.com/browse/MIFOSTEST-663
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void closeClientAccountWithQG() throws Exception {
//Given
String groupName = "group1";
CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
clientParams.setFirstName("John");
clientParams.setLastName("Doe4321");
ClientViewDetailsPage clientPage = clientTestHelper.createNewClient(groupName, clientParams);
String clientName = clientPage.getGlobalCustNum();
clientTestHelper.changeCustomerStatus(clientPage, ClientStatus.ACTIVE);
createQuestions2();
createQuestionGroup2();
String qG_1 = "CloseClientQG";
String qG_2 = "CloseClientQG2";
QuestionResponseParameters responseParams = getQuestionResponseParametersForClientAccountClose("answer1");
QuestionResponseParameters responseParams2 = getQuestionResponseParametersForClientAccountClose("answer2");
QuestionResponseParameters responseParamsAfterModyfication = getQuestionResponseParametersForClientAccountCloseAfterModyfication("answer2");
List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
questionsList.add(newFreeTextQuestionParameters("663new question 1"));
questionsList.add(newFreeTextQuestionParameters("663new question 2"));
questionsList.add(newFreeTextQuestionParameters("663new question 3"));
String[] newActiveQuestions = { "663new question 1", "663new question 2" };
String[] deactivateArray = { "663new question 3", question3, question6, question2, question5 };
String[] deactivatedGroupArray = { question10, question11 };
List<String> deactivateList = Arrays.asList(deactivateArray);
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("663new question 1", "answer2");
questionsAndAnswers.put("663new question 2", "answer2");
questionsAndAnswers.put(question1, "24/01/2011");
questionsAndAnswers.put(question4, "10");
questionsAndAnswers.put(question7, "24/01/2011");
questionsAndAnswers.put(question8, "jan");
questionsAndAnswers.put(question9, "answer2");
//When / Then
QuestionResponsePage responsePage = clientTestHelper.navigateToQuestionResponsePageWhenCloseClientAccount(clientName);
responsePage.populateAnswers(responseParams);
responsePage.navigateToNextPage();
responsePage = new CustomerChangeStatusPreviewPage(selenium).navigateToEditAdditionalInformation();
responsePage.populateAnswers(responseParams2);
responsePage.navigateToNextPage();
new CustomerChangeStatusPreviewPage(selenium).cancelAndGotoClientViewDetailsPage();
QuestionGroupTestHelper questionTestHelper = new QuestionGroupTestHelper(selenium);
questionTestHelper.addNewQuestionsToQuestionGroup(qG_1, questionsList);
questionTestHelper.markQuestionsAsInactive(deactivateList);
questionTestHelper.markQuestionGroupAsInactive(qG_2);
responsePage = clientTestHelper.navigateToQuestionResponsePageWhenCloseClientAccount(clientName);
responsePage.verifyQuestionsDoesnotappear(deactivateArray);
responsePage.verifyQuestionsDoesnotappear(deactivatedGroupArray);
responsePage.verifyQuestionsExists(newActiveQuestions);
clientTestHelper.closeClientWithQG(clientName, responseParamsAfterModyfication);
verifyQuestionResponsesExistInDatabase(clientName, "Close Client", questionsAndAnswers);
questionTestHelper.markQuestionsAsInactive(asList("663new question 1", "663new question 2", question1, question2, question4, question7, question8, question9, question10, question11));
questionTestHelper.markQuestionGroupAsInactive(qG_1);
}
use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.
the class GroupTest method getCreateQuestionParams.
private CreateQuestionParameters getCreateQuestionParams(String title, String type, Integer numericMin, Integer numericMax, List<Choice> choices) {
CreateQuestionParameters parameters = new CreateQuestionParameters();
parameters.setText(title);
parameters.setType(type);
parameters.setChoices(choices);
parameters.setNumericMin(numericMin);
parameters.setNumericMax(numericMax);
return parameters;
}
use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.
the class GroupTest method createGroupWithQuestionGroup.
@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" }, enabled = true)
// https://mifosforge.jira.com/browse/MIFOS-5850
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createGroupWithQuestionGroup() throws Exception {
//Given
CreateQuestionGroupParameters questionGroupParams = new CreateQuestionGroupParameters();
questionGroupParams.setTitle("CreateGroupQG");
questionGroupParams.setAppliesTo("Create Group");
questionGroupParams.setAnswerEditable(true);
questionGroupParams.addExistingQuestion("Sec 1", "Date");
questionGroupParams.addExistingQuestion("Sec 1", "ToBeDisabled");
questionGroupParams.addExistingQuestion("Sec 2", "FreeText");
questionGroupParams.addExistingQuestion("Sec 2", "SingleSelect");
questionGroupTestHelper.createQuestionGroup(questionGroupParams);
CreateQuestionGroupParameters questionGroupParams2 = new CreateQuestionGroupParameters();
questionGroupParams2.setTitle("CreateGroupQG2");
questionGroupParams2.setAppliesTo("Create Group");
questionGroupParams2.setAnswerEditable(true);
questionGroupParams2.addExistingQuestion("Sec 1", "DateQuestion");
questionGroupParams2.addExistingQuestion("Sec 1", "Number");
questionGroupParams2.addExistingQuestion("Sec 2", "MultiSelect");
questionGroupParams2.addExistingQuestion("Sec 2", "Text");
questionGroupTestHelper.createQuestionGroup(questionGroupParams2);
CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
groupParams.setGroupName("GroupTest");
String centerName = "Default Center";
String qG_1 = "CreateGroupQG";
String qG_2 = "CreateGroupQG2";
QuestionResponseParameters responseParams = getQuestionResponseParametersForGroupCreation("answer1");
QuestionResponseParameters responseParams2 = getQuestionResponseParametersForGroupCreation("answer2");
List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
questionsList.add(newFreeTextQuestionParameters("new question 1"));
questionsList.add(newFreeTextQuestionParameters("new question 2"));
questionsList.add(newFreeTextQuestionParameters("new question 3"));
String[] newActiveQuestions = { "new question 1", "new question 2" };
String[] deactivateArray = { "new question 3", "SingleSelect", "ToBeDisabled" };
String[] deactivatedGroupArray = { "MultiSelect", "DateQuestion" };
List<String> deactivateList = Arrays.asList(deactivateArray);
//When / Then
GroupViewDetailsPage groupViewDetailsPage = groupTestHelper.createGroupWithQuestionGroupsEdited(groupParams, centerName, responseParams, responseParams2);
groupViewDetailsPage.navigateToViewAdditionalInformationPage().navigateBack();
QuestionGroupTestHelper questionTestHelper = new QuestionGroupTestHelper(selenium);
questionTestHelper.addNewQuestionsToQuestionGroup(qG_1, questionsList);
questionTestHelper.markQuestionsAsInactive(deactivateList);
questionTestHelper.markQuestionGroupAsInactive(qG_2);
QuestionResponsePage responsePage = groupTestHelper.navigateToQuestionResponsePageWhenCreatingGroup(groupParams, centerName);
responsePage.verifyQuestionsDoesnotappear(deactivateArray);
responsePage.verifyQuestionsDoesnotappear(deactivatedGroupArray);
responsePage.verifyQuestionsExists(newActiveQuestions);
groupViewDetailsPage = navigationHelper.navigateToGroupViewDetailsPage(groupParams.getGroupName());
ViewQuestionResponseDetailPage responseDetailsPage = groupViewDetailsPage.navigateToViewAdditionalInformationPage();
responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
questionGroupTestHelper.markQuestionGroupAsInactive(qG_1);
questionTestHelper.markQuestionAsActive("SingleSelect");
questionTestHelper.markQuestionAsActive("ToBeDisabled");
}
use of org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters in project head by mifos.
the class QuestionGroupTestHelper method createQuestions.
public void createQuestions(List<CreateQuestionParameters> questions) {
AdminPage adminPage = navigationHelper.navigateToAdminPage();
CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
for (CreateQuestionParameters question : questions) {
createQuestionPage.addQuestion(question);
}
adminPage = createQuestionPage.submitQuestions();
}
Aggregations