Search in sources :

Example 1 with ViewQuestionResponseDetailPage

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

the class ClientTestHelper method editQuestionGroupResponses.

public ClientViewDetailsPage editQuestionGroupResponses(ClientViewDetailsPage clientViewDetailsPage, String numberSection, String locator, String response) {
    ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = clientViewDetailsPage.navigateToViewAdditionalInformationPage();
    viewQuestionResponseDetailPage.verifyPage();
    QuestionnairePage questionnairePage = viewQuestionResponseDetailPage.navigateToEditSection(numberSection);
    questionnairePage.verifyPage();
    selenium.type(locator, response);
    ClientViewDetailsPage clientViewDetailsPage2 = (ClientViewDetailsPage) questionnairePage.submit();
    clientViewDetailsPage2.verifyPage("ViewClientDetails");
    return clientViewDetailsPage2;
}
Also used : ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)

Example 2 with ViewQuestionResponseDetailPage

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

the class GroupTest method createGroupInPendingApprovalStateTestWithSurveys.

@Test(singleThreaded = true, groups = { "smoke", "group", "acceptance", "ui", "no_db_unit" })
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createGroupInPendingApprovalStateTestWithSurveys() throws Exception {
    QuestionGroupTestHelper questionGroupTestHelper = new QuestionGroupTestHelper(selenium);
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "Nu_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    List<Choice> choices = asList(new Choice("Choice1", asList("Tag1", "Tag2")), new Choice("Choice2", asList("Tag3", "Tag4")));
    createQuestionGroupForCreateGroup(questionGroupTitle, question1, question2, choices);
    CreateGroupEntryPage groupEntryPage = loginAndNavigateToNewGroupPage();
    CreateGroupSubmitParameters formParameters = getGenericGroupFormParameters();
    QuestionResponsePage questionResponsePage = groupEntryPage.submitNewGroupAndNavigateToQuestionResponsePage(formParameters);
    questionResponsePage.verifyPage();
    questionResponsePage.verifyNumericBoundsValidation("name=questionGroups[0].sectionDetails[0].questions[0].value", "1000", 10, 100, question1);
    questionResponsePage.populateTextAnswer("name=questionGroups[0].sectionDetails[0].questions[0].value", "30");
    questionResponsePage.populateSmartSelect("txtListSearch", getChoiceTags());
    GroupViewDetailsPage groupViewDetailsPage = questionResponsePage.navigateToCreateGroupDetailsPage("Application Pending*");
    ViewQuestionResponseDetailPage responsePage = groupViewDetailsPage.navigateToViewAdditionalInformationPage();
    responsePage.verifyPage();
    responsePage.verifyQuestionPresent(question1, "30");
    responsePage.verifyQuestionPresent(question2, "Choice", "Choice2");
    responsePage.navigateToDetailsPage();
    questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) Choice(org.mifos.test.acceptance.framework.questionnaire.Choice) CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) CreateGroupEntryPage(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage) Test(org.testng.annotations.Test)

Example 3 with ViewQuestionResponseDetailPage

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

the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.

@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    String answer = "01/01/2010";
    String choiceAnswer = "Choice2";
    questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
    loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("client1 lastname");
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    QuestionResponseParameters parameters = new QuestionResponseParameters();
    parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
    parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
    LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
    ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
    questionResponseDetailPage.verifyPage();
    questionResponseDetailPage.verifyQuestionPresent(question1, answer);
    questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
    questionResponseDetailPage.navigateToDetailsPage();
    questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 4 with ViewQuestionResponseDetailPage

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

the class CenterTest method createCenterTest.

/**
     * Capturing responses during the Center creation http://mifosforge.jira.com/browse/MIFOSTEST-665
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createCenterTest() throws Exception {
    String officeName = "MyOfficeDHMFT";
    String qG1Name = "CreateCenterQG";
    String qG2Name = "CreateCenterQG2";
    createQuestions();
    CreateQuestionGroupParameters qG1 = questionTestHelper.getCreateQuestionGroupParameters(qG1Name, asList("center question 1", "center question 2", "center question 3"), "Create Center", "Sec 1");
    questionTestHelper.createQuestionGroup(qG1);
    CreateQuestionGroupParameters qG2 = questionTestHelper.getCreateQuestionGroupParameters(qG2Name, asList("center question 4", "center question 5", "center question 6"), "Create Center", "Sec 2");
    questionTestHelper.createQuestionGroup(qG2);
    String testCenterName = "Center" + StringUtil.getRandomString(6);
    CreateCenterEnterDataPage.SubmitFormParameters centerParams = getCenterParameters(testCenterName, "loan officer");
    QuestionResponseParameters responseParams = getQuestionResponseParameters("answer1");
    QuestionResponseParameters responseParams2 = getQuestionResponseParameters("answer2");
    List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
    questionsList.add(newFreeTextQuestionParameters("new center question 1"));
    questionsList.add(newFreeTextQuestionParameters("new center question 2"));
    String[] newActiveQuestions = { "new center question 1", "center question 2" };
    String[] deactivateArray = { "center question 3", "center question 4" };
    List<String> deactivateList = Arrays.asList(deactivateArray);
    CenterViewDetailsPage centerViewDetailsPage = centerTestHelper.createCenterWithQuestionGroupsEdited(centerParams, officeName, responseParams, responseParams2);
    centerViewDetailsPage.navigateToViewAdditionalInformation().navigateBack();
    questionTestHelper.addNewQuestionsToQuestionGroup(qG1Name, questionsList);
    questionTestHelper.markQuestionsAsInactive(deactivateList);
    questionTestHelper.markQuestionGroupAsInactive(qG2Name);
    QuestionResponsePage responsePage = centerTestHelper.navigateToQuestionResponsePageWhenCreatingCenter(centerParams, officeName);
    responsePage.verifyQuestionsDoesnotappear(deactivateArray);
    responsePage.verifyQuestionsExists(newActiveQuestions);
    centerViewDetailsPage = centerTestHelper.navigateToCenterViewDetailsPage(testCenterName);
    centerViewDetailsPage.verifyActiveCenter(centerParams);
    ViewQuestionResponseDetailPage responseDetailsPage = centerViewDetailsPage.navigateToViewAdditionalInformation();
    responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
    responseDetailsPage.verifyEditButtonDisabled("1");
    QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
    questionTestHelper.markQuestionGroupAsInactive(qG1Name);
}
Also used : CreateCenterEnterDataPage(org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) 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) CenterViewDetailsPage(org.mifos.test.acceptance.framework.center.CenterViewDetailsPage) Test(org.testng.annotations.Test)

Example 5 with ViewQuestionResponseDetailPage

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

Aggregations

ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)10 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)6 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)5 Test (org.testng.annotations.Test)5 ArrayList (java.util.ArrayList)4 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)3 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)3 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)3 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 HashMap (java.util.HashMap)2 CenterViewDetailsPage (org.mifos.test.acceptance.framework.center.CenterViewDetailsPage)2 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)2 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)2 GroupViewDetailsPage (org.mifos.test.acceptance.framework.group.GroupViewDetailsPage)2 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)2 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)2 QuestionGroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper)2 List (java.util.List)1 DateTime (org.joda.time.DateTime)1 DefineNewOfficePage (org.mifos.test.acceptance.framework.admin.DefineNewOfficePage)1