Search in sources :

Example 1 with EditQuestionGroupPage

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

the class QuestionGroupTest method testEditQuestionGroupDetail.

private void testEditQuestionGroupDetail(QuestionGroupDetailPage questionGroupDetailPage) {
    EditQuestionGroupPage editQuestionGroupPage = questionGroupDetailPage.navigateToEditPage();
    editQuestionGroupPage.setTitle(qgTitle3);
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.addExistingQuestion("New Section", qTitle4);
    for (String section : createQuestionGroupParameters.getExistingQuestions().keySet()) {
        editQuestionGroupPage.addExistingQuestion(section, createQuestionGroupParameters.getExistingQuestions().get(section));
    }
    CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
    createQuestionParameters.setType("Free Text");
    createQuestionParameters.setText(qTitle5);
    editQuestionGroupPage.setSection("Hello World");
    editQuestionGroupPage.addNewQuestion(createQuestionParameters);
    editQuestionGroupPage.submit();
    questionGroupDetailPage.verifyPage();
    questionGroupDetailPage.navigateToViewQuestionGroupsPage();
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) EditQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)

Example 2 with EditQuestionGroupPage

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

the class QuestionGroupTestHelper method addQuestionsToQuestionGroup.

public void addQuestionsToQuestionGroup(String questionGroup, Map<String, List<String>> existingQuestions) {
    EditQuestionGroupPage editQuestionGroupPage = naviagateToEditQuestionGroup(questionGroup);
    for (String section : existingQuestions.keySet()) {
        editQuestionGroupPage.addExistingQuestion(section, existingQuestions.get(section));
    }
    editQuestionGroupPage.submit();
}
Also used : EditQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage)

Example 3 with EditQuestionGroupPage

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

the class QuestionGroupTestHelper method markQuestionGroupAsInactive.

public void markQuestionGroupAsInactive(String questionGroup) {
    EditQuestionGroupPage editQuestionGroupPage = naviagateToEditQuestionGroup(questionGroup);
    editQuestionGroupPage.deactivate();
}
Also used : EditQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage)

Example 4 with EditQuestionGroupPage

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

the class QuestionGroupTestHelper method markQuestionGroupAsActive.

public void markQuestionGroupAsActive(String questionGroup) {
    EditQuestionGroupPage editQuestionGroupPage = naviagateToEditQuestionGroup(questionGroup);
    editQuestionGroupPage.activate();
}
Also used : EditQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage)

Example 5 with EditQuestionGroupPage

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

the class QuestionGroupTest method editQuestionGroupsForCreateOffice.

/**
     * Verify that user is able to edit the defined Question Groups
     * and create Office with edited Question Group
     * http://mifosforge.jira.com/browse/MIFOSTEST-666
     *
     * @throws Exception
     */
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void editQuestionGroupsForCreateOffice() throws Exception {
    //When
    ViewAllQuestionGroupsPage viewAllQuestionGroupsPage = questionGroupTestHelper.navigateToViewQuestionGroups(QUESTIONS_LIST);
    String oldTitle = "CreateOffice";
    EditQuestionGroupPage editQuestionGroupPage = viewAllQuestionGroupsPage.navigateToQuestionGroupDetailPage(oldTitle).navigateToEditPage();
    editQuestionGroupPage.moveSectionUp("Misc");
    editQuestionGroupPage.moveQuestionUp(9);
    editQuestionGroupPage.moveQuestionDown(2);
    String newTitle = "CreateOfficeQG";
    QuestionGroupDetailPage questionGroupDetailPage = editQuestionGroupPage.editQuestionGroup(false, newTitle, "Create Office", Collections.<String>emptyList());
    //Then
    questionGroupDetailPage.verifyOrderQuestions(asList("MultiSelect", "Date", "FreeText"), 4);
    questionGroupDetailPage.verifyOrderSections(asList("Misc", "Default"));
    questionGroupDetailPage.verifyMandatoryQuestions(Arrays.asList("FreeText"), "Misc");
    questionGroupDetailPage.verifyMandatoryQuestions(EMPTY_LIST, "Default");
    questionGroupDetailPage.verifyTitle(newTitle);
    questionGroupTestHelper.markQuestionGroupAsActive(newTitle);
    createOfficeWithQuestionGroup();
    questionGroupTestHelper.markQuestionGroupAsInactive(newTitle);
    //When
    viewAllQuestionGroupsPage = questionGroupDetailPage.navigateToViewQuestionGroupsPage();
    //Then
    viewAllQuestionGroupsPage.verifyInactiveQuestions(0, 0);
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) EditQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage) QuestionGroupDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage) Test(org.testng.annotations.Test)

Aggregations

EditQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage)7 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)1 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)1 QuestionGroupDetailPage (org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage)1 ViewAllQuestionGroupsPage (org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage)1 Test (org.testng.annotations.Test)1