Search in sources :

Example 1 with ViewAllQuestionGroupsPage

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

the class QuestionGroupTest method testViewQuestionGroups.

private void testViewQuestionGroups() {
    ViewAllQuestionGroupsPage viewQuestionGroupsPage = getViewQuestionGroupsPage(new AdminPage(selenium));
    testViewQuestionGroups(viewQuestionGroupsPage);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle1, SECTION_DEFAULT, asList(qTitle1, qTitle2), asList(qTitle1));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle1, SECTION_MISC, asList(qTitle4), EMPTY_LIST);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle2, SECTION_MISC, asList(qTitle1, qTitle3), asList(qTitle1));
    testEditQuestionGroupDetail(viewQuestionGroupsPage.navigateToQuestionGroupDetailPage(qgTitle2));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, SECTION_MISC, asList(qTitle1, qTitle3), asList(qTitle1));
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, "New Section", asList(qTitle4), EMPTY_LIST);
    testQuestionGroupDetail(viewQuestionGroupsPage, qgTitle3, "Hello World", asList(qTitle5), EMPTY_LIST);
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage)

Example 2 with ViewAllQuestionGroupsPage

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

the class QuestionGroupTestHelper method navigateToViewQuestionGroups.

public ViewAllQuestionGroupsPage navigateToViewQuestionGroups(List<String> questions) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewAllQuestionGroupsPage viewAllQuestionGroupsPage = adminPage.navigateToViewAllQuestionGroups();
    viewAllQuestionGroupsPage.verifyQuestionGroup(questions);
    return viewAllQuestionGroupsPage;
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage)

Example 3 with ViewAllQuestionGroupsPage

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

the class QuestionGroupTestHelper method naviagateToEditQuestionGroup.

public EditQuestionGroupPage naviagateToEditQuestionGroup(String questionGroup) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewAllQuestionGroupsPage allQuestionGroupsPage = adminPage.navigateToViewAllQuestionGroups();
    QuestionGroupDetailPage questionGroupDetailPage = allQuestionGroupsPage.navigateToQuestionGroupDetailPage(questionGroup);
    return questionGroupDetailPage.navigateToEditPage();
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) QuestionGroupDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage)

Example 4 with ViewAllQuestionGroupsPage

use of org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage 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)

Example 5 with ViewAllQuestionGroupsPage

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

the class QuestionGroupTestHelper method naviagateToEditQuestionGroup.

public EditQuestionGroupPage naviagateToEditQuestionGroup(int questionGroupId) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewAllQuestionGroupsPage allQuestionGroupsPage = adminPage.navigateToViewAllQuestionGroups();
    QuestionGroupDetailPage questionGroupDetailPage = allQuestionGroupsPage.navigateToQuestionGroupDetailPage(questionGroupId);
    return questionGroupDetailPage.navigateToEditPage();
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) QuestionGroupDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage)

Aggregations

ViewAllQuestionGroupsPage (org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage)5 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)4 QuestionGroupDetailPage (org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage)3 EditQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.EditQuestionGroupPage)1 Test (org.testng.annotations.Test)1