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());
}
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);
}
Aggregations