Search in sources :

Example 21 with QuestionResponsePage

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

Aggregations

QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)21 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)10 ArrayList (java.util.ArrayList)9 Test (org.testng.annotations.Test)9 HashMap (java.util.HashMap)7 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)6 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)6 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)5 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)5 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)4 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)3 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)3 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 QuestionGroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper)3 List (java.util.List)2 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)2 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)2 CustomerChangeStatusPreviewPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)2 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)2