Search in sources :

Example 11 with QuestionnairePage

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

the class GroupTest method createGroupWithQuestionGroup.

@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" }, enabled = true)
// https://mifosforge.jira.com/browse/MIFOS-5850
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createGroupWithQuestionGroup() throws Exception {
    //Given
    CreateQuestionGroupParameters questionGroupParams = new CreateQuestionGroupParameters();
    questionGroupParams.setTitle("CreateGroupQG");
    questionGroupParams.setAppliesTo("Create Group");
    questionGroupParams.setAnswerEditable(true);
    questionGroupParams.addExistingQuestion("Sec 1", "Date");
    questionGroupParams.addExistingQuestion("Sec 1", "ToBeDisabled");
    questionGroupParams.addExistingQuestion("Sec 2", "FreeText");
    questionGroupParams.addExistingQuestion("Sec 2", "SingleSelect");
    questionGroupTestHelper.createQuestionGroup(questionGroupParams);
    CreateQuestionGroupParameters questionGroupParams2 = new CreateQuestionGroupParameters();
    questionGroupParams2.setTitle("CreateGroupQG2");
    questionGroupParams2.setAppliesTo("Create Group");
    questionGroupParams2.setAnswerEditable(true);
    questionGroupParams2.addExistingQuestion("Sec 1", "DateQuestion");
    questionGroupParams2.addExistingQuestion("Sec 1", "Number");
    questionGroupParams2.addExistingQuestion("Sec 2", "MultiSelect");
    questionGroupParams2.addExistingQuestion("Sec 2", "Text");
    questionGroupTestHelper.createQuestionGroup(questionGroupParams2);
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName("GroupTest");
    String centerName = "Default Center";
    String qG_1 = "CreateGroupQG";
    String qG_2 = "CreateGroupQG2";
    QuestionResponseParameters responseParams = getQuestionResponseParametersForGroupCreation("answer1");
    QuestionResponseParameters responseParams2 = getQuestionResponseParametersForGroupCreation("answer2");
    List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
    questionsList.add(newFreeTextQuestionParameters("new question 1"));
    questionsList.add(newFreeTextQuestionParameters("new question 2"));
    questionsList.add(newFreeTextQuestionParameters("new question 3"));
    String[] newActiveQuestions = { "new question 1", "new question 2" };
    String[] deactivateArray = { "new question 3", "SingleSelect", "ToBeDisabled" };
    String[] deactivatedGroupArray = { "MultiSelect", "DateQuestion" };
    List<String> deactivateList = Arrays.asList(deactivateArray);
    //When / Then
    GroupViewDetailsPage groupViewDetailsPage = groupTestHelper.createGroupWithQuestionGroupsEdited(groupParams, centerName, responseParams, responseParams2);
    groupViewDetailsPage.navigateToViewAdditionalInformationPage().navigateBack();
    QuestionGroupTestHelper questionTestHelper = new QuestionGroupTestHelper(selenium);
    questionTestHelper.addNewQuestionsToQuestionGroup(qG_1, questionsList);
    questionTestHelper.markQuestionsAsInactive(deactivateList);
    questionTestHelper.markQuestionGroupAsInactive(qG_2);
    QuestionResponsePage responsePage = groupTestHelper.navigateToQuestionResponsePageWhenCreatingGroup(groupParams, centerName);
    responsePage.verifyQuestionsDoesnotappear(deactivateArray);
    responsePage.verifyQuestionsDoesnotappear(deactivatedGroupArray);
    responsePage.verifyQuestionsExists(newActiveQuestions);
    groupViewDetailsPage = navigationHelper.navigateToGroupViewDetailsPage(groupParams.getGroupName());
    ViewQuestionResponseDetailPage responseDetailsPage = groupViewDetailsPage.navigateToViewAdditionalInformationPage();
    responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
    QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
    questionGroupTestHelper.markQuestionGroupAsInactive(qG_1);
    questionTestHelper.markQuestionAsActive("SingleSelect");
    questionTestHelper.markQuestionAsActive("ToBeDisabled");
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) Test(org.testng.annotations.Test)

Example 12 with QuestionnairePage

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

the class SavingsAccountHelper method fillQuestionGroupsDurringCreationSavingsAccount.

public CreateSavingsAccountPreviewPage fillQuestionGroupsDurringCreationSavingsAccount(CreateSavingsAccountSearchParameters searchParameters, CreateSavingsAccountSubmitParameters submitAccountParameters, QuestionResponseParameters responseParams) {
    CreateSavingsAccountSearchPage createSavingsAccountSearchPage = navigateToCreateSavingsAccountSearchPage();
    createSavingsAccountSearchPage.verifyPage();
    CreateSavingsAccountEntryPage createSavingsAccountEntryPage = createSavingsAccountSearchPage.searchAndNavigateToCreateSavingsAccountPage(searchParameters);
    createSavingsAccountEntryPage.verifyPage();
    QuestionnairePage questionnairePage = createSavingsAccountEntryPage.submitAndNavigateToQuestionnairePage(submitAccountParameters);
    questionnairePage.populateAnswers(responseParams);
    return questionnairePage.navigateToNextPageSavingsAccountCreation();
}
Also used : CreateSavingsAccountSearchPage(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) CreateSavingsAccountEntryPage(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountEntryPage)

Example 13 with QuestionnairePage

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

the class SavingsAccountHelper method editAdditionalInformationDurringCreationSavingsAccount.

public SavingsAccountDetailPage editAdditionalInformationDurringCreationSavingsAccount(QuestionResponseParameters responseParams) {
    CreateSavingsAccountPreviewPage createSavingsAccountPreviewPage = new CreateSavingsAccountPreviewPage(selenium);
    QuestionnairePage questionnairePage = createSavingsAccountPreviewPage.editAdditionalInformationQuestionnairePage();
    UiTestUtils.sleep(1500);
    questionnairePage.populateAnswers(responseParams);
    createSavingsAccountPreviewPage = questionnairePage.navigateToNextPageSavingsAccountCreation();
    createSavingsAccountPreviewPage.verifyPage();
    CreateSavingsAccountConfirmationPage createSavingsAccountConfirmationPage = createSavingsAccountPreviewPage.submitForApproval();
    SavingsAccountDetailPage savingsAccountDetailPage = createSavingsAccountConfirmationPage.navigateToSavingsAccountDetailsPage();
    savingsAccountDetailPage.verifyPage();
    return savingsAccountDetailPage;
}
Also used : QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) CreateSavingsAccountConfirmationPage(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) CreateSavingsAccountPreviewPage(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountPreviewPage)

Example 14 with QuestionnairePage

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

the class QuestionGroupTestHelper method verifyErrorsWhileAttachingQuestionGroupToSavingsAccount.

public SavingsAccountDetailPage verifyErrorsWhileAttachingQuestionGroupToSavingsAccount(AttachQuestionGroupParameters attachParams) {
    QuestionnairePage questionnairePage = (QuestionnairePage) navigationHelper.navigateToSavingsAccountDetailPage(attachParams.getTarget()).navigateToAttachSurveyPage().cancelAttachQuestionGroup(attachParams.getQuestionGroupName()).navigateToAttachSurveyPage().selectSurvey(attachParams.getQuestionGroupName()).setResponses(attachParams.getTextResponses()).checkResponses(attachParams.getCheckResponses()).cancelAndNavigateToSavingsAccountDetailPage().navigateToAttachSurveyPage().selectSurvey(attachParams.getQuestionGroupName()).setResponses(attachParams.getTextResponses()).checkResponses(attachParams.getCheckResponses()).submit();
    questionnairePage.verifyErrorsOnPage(attachParams.getErrors());
    return questionnairePage.cancelAndNavigateToSavingsAccountDetailPage();
}
Also used : QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)

Example 15 with QuestionnairePage

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

the class QuestionGroupTestHelper method verifyErrorsWhileAttachingQuestionGroupToLoan.

public LoanAccountPage verifyErrorsWhileAttachingQuestionGroupToLoan(AttachQuestionGroupParameters attachParams) {
    QuestionnairePage questionnairePage = (QuestionnairePage) navigationHelper.navigateToLoanAccountPage(attachParams.getTarget()).navigateToAttachSurveyPage().selectSurvey(attachParams.getQuestionGroupName()).setResponses(attachParams.getTextResponses()).checkResponses(attachParams.getCheckResponses()).submitAndNavigateToLoanViewDetailsPage();
    questionnairePage.verifyErrorsOnPage(attachParams.getErrors());
    return questionnairePage.cancelAndNavigateToLoanViewDetailsPage();
}
Also used : QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)

Aggregations

QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)19 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)6 ArrayList (java.util.ArrayList)4 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)4 MifosPage (org.mifos.test.acceptance.framework.MifosPage)3 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)3 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)3 QuestionGroupResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage)3 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)3 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)3 Test (org.testng.annotations.Test)3 HashMap (java.util.HashMap)2 AttachSurveyPage (org.mifos.test.acceptance.framework.loan.AttachSurveyPage)2 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)2 List (java.util.List)1 DateTime (org.joda.time.DateTime)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 CenterViewDetailsPage (org.mifos.test.acceptance.framework.center.CenterViewDetailsPage)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)1