Search in sources :

Example 6 with QuestionResponseParameters

use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.

the class ClientLoanStatusChangeTest method pendingApprovalToApplicationApprovedWithQuestionGroup.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void pendingApprovalToApplicationApprovedWithQuestionGroup() throws Exception {
    String qgForLoanApproval = "QGForLoanApproval";
    QuestionGroupTestHelper questionGroupTestHelper = new QuestionGroupTestHelper(selenium);
    questionGroupTestHelper.markQuestionGroupAsActive(qgForLoanApproval);
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test");
    QuestionResponseParameters responseParameters = new QuestionResponseParameters();
    responseParameters.addTextAnswer("create_ClientPersonalInfo.input.customField", "testResponse");
    loanTestHelper.changeLoanAccountStatusProvidingQuestionGroupResponses("000100000000055", statusParameters, responseParameters);
    questionGroupTestHelper.markQuestionGroupAsInactive(qgForLoanApproval);
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)

Example 7 with QuestionResponseParameters

use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.

the class QuestionGroupTest method getResponse.

private QuestionResponseParameters getResponse(String answer) {
    QuestionResponseParameters initialResponse = new QuestionResponseParameters();
    initialResponse.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", answer);
    return initialResponse;
}
Also used : QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)

Example 8 with QuestionResponseParameters

use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.

the class QuestionGroupTest method createOfficeWithQuestionGroup.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
private void createOfficeWithQuestionGroup() throws Exception {
    //When
    QuestionResponsePage questionResponsePage = officeHelper.navigateToQuestionResponsePage(getOfficeParameters("MyOfficeDHMFT", "DHM"));
    QuestionResponseParameters initialResponse = getResponse("123");
    QuestionResponseParameters updatedResponse = getResponse("1234");
    CreateOfficePreviewDataPage createOfficePreviewDataPage = questionGroupTestHelper.createOfficeWithQuestionGroup(questionResponsePage, initialResponse, updatedResponse);
    assertTextFoundOnPage("This office name already exist");
    DefineNewOfficePage defineNewOfficePage = createOfficePreviewDataPage.editOfficeInformation();
    defineNewOfficePage.setOfficeName("TestOffice");
    defineNewOfficePage.setOfficeShortName("TO");
    defineNewOfficePage.preview();
    defineNewOfficePage.next();
    OfficeViewDetailsPage officeViewDetailsPage = createOfficePreviewDataPage.submit().navigateToOfficeViewDetailsPage();
    ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = officeViewDetailsPage.navigateToViewAdditionalInformation();
    viewQuestionResponseDetailPage.verifyQuestionPresent("FreeText", "1234");
    officeViewDetailsPage = viewQuestionResponseDetailPage.navigateToDetailsPage();
    String newQuestion = "Text";
    addQuestion(newQuestion, "Default", CREATE_OFFICE_QUESTION_GROUP_ID);
    String questionToDeactivate = "FreeText";
    questionGroupTestHelper.markQuestionAsInactive(questionToDeactivate);
    questionResponsePage = officeHelper.navigateToQuestionResponsePage(getOfficeParameters("TestOffice2", "TO2"));
    //Then
    questionResponsePage.verifyQuestionsDoesnotappear(new String[] { questionToDeactivate });
    questionResponsePage.verifyQuestionsExists(new String[] { newQuestion });
    officeHelper.verifyQuestionPresent("TestOffice", "Text", "");
}
Also used : ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) DefineNewOfficePage(org.mifos.test.acceptance.framework.admin.DefineNewOfficePage) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) CreateOfficePreviewDataPage(org.mifos.test.acceptance.framework.office.CreateOfficePreviewDataPage) OfficeViewDetailsPage(org.mifos.test.acceptance.framework.office.OfficeViewDetailsPage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)

Example 9 with QuestionResponseParameters

use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters 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 10 with QuestionResponseParameters

use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.

the class ClientTest method getQuestionResponseParametersForClientAccountClose.

private QuestionResponseParameters getQuestionResponseParametersForClientAccountClose(String answer) {
    QuestionResponseParameters responseParams = new QuestionResponseParameters();
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "24/01/2011");
    responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].valuesAsArray", "first");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "10");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "10");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[4].value", answer);
    responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "good");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "24/01/2011");
    responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[2].valuesAsArray", "feb");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[1].questions[3].value", answer);
    responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "24/01/2011");
    responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "10");
    responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[2].value", answer);
    responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[0].questions[3].value", "good");
    responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].value", "1");
    responseParams.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", answer);
    responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[2].valuesAsArray", "jan");
    responseParams.addTextAnswer("questionGroups[1].sectionDetails[1].questions[3].value", answer);
    return responseParams;
}
Also used : QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)

Aggregations

QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)21 ArrayList (java.util.ArrayList)10 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)10 Test (org.testng.annotations.Test)10 HashMap (java.util.HashMap)8 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)7 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)5 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)5 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)5 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)4 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)4 DateTime (org.joda.time.DateTime)3 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)3 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)3 QuestionGroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper)3 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)3 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)2 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)2 CreateSavingsAccountSearchParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters)2 CreateSavingsAccountSubmitParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)2