Search in sources :

Example 21 with CreateQuestionGroupParameters

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

the class QuestionGroupTest method addQuestion.

private void addQuestion(String newQuestion, String section, int questionGroupId) {
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.addExistingQuestion(section, newQuestion);
    questionGroupTestHelper.addQuestionsToQuestionGroup(questionGroupId, createQuestionGroupParameters.getExistingQuestions());
}
Also used : CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)

Example 22 with CreateQuestionGroupParameters

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

the class QuestionGroupTest method checkQuestionGroupPermission.

@Test(enabled = true)
public void checkQuestionGroupPermission() {
    AdminPage adminPage = getAdminPage();
    CreateQuestionGroupPage createQuestionGroupPage = getCreateQuestionGroupPage(adminPage);
    CreateQuestionGroupParameters parameters = new CreateQuestionGroupParameters();
    parameters.setTitle(qgTitle4);
    parameters.setAppliesTo(APPLIES_TO_CREATE_CLIENT);
    parameters.setAnswerEditable(true);
    for (String question : asList(qTitle1, qTitle2)) {
        parameters.addExistingQuestion(SECTION_DEFAULT, question);
    }
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.submit(parameters);
    ViewRolesPage rolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = rolesPage.navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.disablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage();
    adminPage = getAdminPage();
    Assert.assertTrue(adminPage.navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4).isAccessDeniedDisplayed());
    //set question group on inactive
    adminPage.navigateBack();
    adminPage.navigateToAdminPageUsingHeaderTab();
    manageRolePage = adminPage.navigateToViewRolesPage().navigateToManageRolePage(ADMIN_ROLE);
    manageRolePage.verifyPermissionText(QUESTION_PERMISSION_ID, QUESTION_PERMISSION_HEADER + qgTitle4);
    manageRolePage.enablePermission(QUESTION_PERMISSION_ID);
    manageRolePage.submitAndGotoViewRolesPage().navigateToAdminPage().navigateToViewAllQuestionGroups().navigateToQuestionGroupDetailPage(qgTitle4);
    questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle4);
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage) Test(org.testng.annotations.Test)

Aggregations

CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)22 ArrayList (java.util.ArrayList)9 Test (org.testng.annotations.Test)8 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)7 HashMap (java.util.HashMap)6 List (java.util.List)6 CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)6 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)5 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)4 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)4 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)4 AttachQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters)3 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)3 Arrays.asList (java.util.Arrays.asList)1 Random (java.util.Random)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 ViewRolesPage (org.mifos.test.acceptance.framework.admin.ViewRolesPage)1 CenterViewDetailsPage (org.mifos.test.acceptance.framework.center.CenterViewDetailsPage)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1