Search in sources :

Example 1 with CreateQuestionGroupPage

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

the class ClientTest method createQuestionGroup2.

private void createQuestionGroup2() {
    String qG_1 = "CloseClientQG";
    String qG_2 = "CloseClientQG2";
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    CreateQuestionGroupParameters parameters;
    parameters = questionGroupTestHelper.getCreateQuestionGroupParameters(qG_1, asList(question1, question2, question3, question4, question5), "Close Client", "Section1");
    parameters.addExistingQuestion("Section2", question7);
    parameters.addExistingQuestion("Section2", question6);
    parameters.addExistingQuestion("Section2", question9);
    parameters.addExistingQuestion("Section2", question8);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.markEveryOtherQuestionsMandatory(asList(question1));
    createQuestionGroupPage.submit(parameters);
    adminPage = navigationHelper.navigateToAdminPage();
    createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    parameters = questionGroupTestHelper.getCreateQuestionGroupParameters(qG_2, asList(question1, question6, question3, question5), "Close Client", "Section1");
    parameters.addExistingQuestion("Section2", question9);
    parameters.addExistingQuestion("Section2", question10);
    parameters.addExistingQuestion("Section2", question8);
    parameters.addExistingQuestion("Section2", question11);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.submit(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 2 with CreateQuestionGroupPage

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

the class QuestionGroupTest method createQuestionGroup.

@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createQuestionGroup() throws Exception {
    try {
        AdminPage adminPage = createQuestions(qTitle1, qTitle2, qTitle3);
        CreateQuestionGroupPage createQuestionGroupPage = getCreateQuestionGroupPage(adminPage);
        testMissingMandatoryInputs(createQuestionGroupPage);
        testCreateQuestionGroup(createQuestionGroupPage, qgTitle1, APPLIES_TO_CREATE_CLIENT, true, SECTION_DEFAULT, asList(qTitle1, qTitle2), asList(qTitle3), qTitle4);
        testShouldAllowDuplicateTitlesForQuestionGroup();
        testCancelCreateQuestionGroup(getCreateQuestionGroupPage(new AdminPage(selenium)));
        testViewQuestionGroups();
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle1);
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle2);
        questionGroupTestHelper.markQuestionGroupAsInactive(qgTitle3);
    }
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage) Test(org.testng.annotations.Test)

Example 3 with CreateQuestionGroupPage

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

the class QuestionGroupTestHelper method validatePageBlankMandatoryField.

public void validatePageBlankMandatoryField() {
    CreateQuestionGroupPage createQuestionGroupPage = navigateToCreateQuestionGroupPage();
    createQuestionGroupPage.submit();
    String error = "Please specify Question Group title";
    createQuestionGroupPage.verifyTextPresent(error, "No text <" + error + "> present on the page");
    error = "Please add at least one section";
    createQuestionGroupPage.verifyTextPresent(error, "No text <" + error + "> present on the page");
    error = "Please choose a valid 'Applies To' value";
    createQuestionGroupPage.verifyTextPresent(error, "No text <" + error + "> present on the page");
    createQuestionGroupPage.cancel();
    Assert.assertEquals(selenium.getAttribute("page.id@title"), AdminPage.PAGE_ID);
}
Also used : CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 4 with CreateQuestionGroupPage

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

the class QuestionGroupHelper method createQuestionGroupSmart.

@SuppressWarnings("unchecked")
public void createQuestionGroupSmart(String questionGroupTitle, String appliesTo, String question1, String choice1, String choice2, List<String> tag1, List<String> tag2) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
    createQuestionPage.addQuestion(getCreateQuestionParams(question1, "Smart Select", asList(choice1, choice2), asList(tag1, tag2)));
    adminPage = createQuestionPage.submitQuestions();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    CreateQuestionGroupParameters parameters = getCreateQuestionGroupParameters(questionGroupTitle, question1, appliesTo);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.markEveryOtherQuestionsMandatory(asList(question1));
    createQuestionGroupPage.submit(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 5 with CreateQuestionGroupPage

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

the class QuestionGroupHelper method createQuestionGroup.

public void createQuestionGroup(String questionGroupTitle, String question1, String question2, String appliesTo) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
    createQuestionPage.addQuestion(getCreateQuestionParams(question1, CreateClientLoanAccountTest.DATE, null));
    createQuestionPage.addQuestion(getCreateQuestionParams(question2, CreateClientLoanAccountTest.SINGLE_SELECT, asList("Choice1", "Choice2")));
    adminPage = createQuestionPage.submitQuestions();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    CreateQuestionGroupParameters parameters = getCreateQuestionGroupParameters(questionGroupTitle, question1, question2, appliesTo);
    for (String section : parameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, parameters.getExistingQuestions().get(section));
    }
    createQuestionGroupPage.markEveryOtherQuestionsMandatory(asList(question1));
    createQuestionGroupPage.submit(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Aggregations

CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)9 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)8 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)6 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)4 Test (org.testng.annotations.Test)2 Random (java.util.Random)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1 ViewRolesPage (org.mifos.test.acceptance.framework.admin.ViewRolesPage)1 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)1