Search in sources :

Example 6 with ViewQuestionResponseDetailPage

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

the class QuestionGroupTestHelper method editQuestionGroupResponsesInCenter.

public CenterViewDetailsPage editQuestionGroupResponsesInCenter(AttachQuestionGroupParameters attachParams) {
    CenterViewDetailsPage centerViewDetailsPage = (CenterViewDetailsPage) navigationHelper.navigateToCenterViewDetailsPage(attachParams.getTarget()).navigateToLatestViewQuestionResponseDetailPage(attachParams.getQuestionGroupName()).navigateToEditSection("0").setResponses(attachParams.getTextResponses()).checkResponses(attachParams.getCheckResponses()).submitAndNavigateToCenterViewDetailsPage();
    ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = centerViewDetailsPage.navigateToLatestViewQuestionResponseDetailPage(attachParams.getQuestionGroupName());
    viewQuestionResponseDetailPage.verifyQuestionsAndAnswers(attachParams);
    viewQuestionResponseDetailPage.navigateBack();
    return new CenterViewDetailsPage(selenium);
}
Also used : ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CenterViewDetailsPage(org.mifos.test.acceptance.framework.center.CenterViewDetailsPage)

Example 7 with ViewQuestionResponseDetailPage

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

the class QuestionGroupTestHelper method editQuestionGroupResponsesInSavingsAccount.

public SavingsAccountDetailPage editQuestionGroupResponsesInSavingsAccount(AttachQuestionGroupParameters attachParams) {
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(attachParams.getTarget()).navigateToLatestViewQuestionResponseDetailPage(attachParams.getQuestionGroupName()).navigateToEditSection("0").setResponses(attachParams.getTextResponses()).checkResponses(attachParams.getCheckResponses()).submitAndNavigateToSavingsAccountDetailPage();
    ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = savingsAccountDetailPage.navigateToLatestViewQuestionResponseDetailPage(attachParams.getQuestionGroupName());
    viewQuestionResponseDetailPage.verifyQuestionsAndAnswers(attachParams);
    viewQuestionResponseDetailPage.navigateBack();
    return new SavingsAccountDetailPage(selenium);
}
Also used : ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)

Example 8 with ViewQuestionResponseDetailPage

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

the class QuestionGroupLoanAccountTest method verifyResponsesDuringCreationOfLoanAccount.

/**
     * Capturing responses during the creation of Loan account
     * http://mifosforge.jira.com/browse/MIFOSTEST-683
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyResponsesDuringCreationOfLoanAccount() throws Exception {
    CreateLoanAccountSearchParameters createLoanAccountSearchParameters = new CreateLoanAccountSearchParameters();
    createLoanAccountSearchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
    createLoanAccountSearchParameters.setSearchString("ClientWithLoan 20110221");
    CreateLoanAccountSubmitParameters formParameters = new CreateLoanAccountSubmitParameters();
    formParameters.setAdditionalFee1("oneTimeFee");
    formParameters.setAdditionalFee2("loanWeeklyFee");
    verifyQGNotDisplayed(createLoanAccountSearchParameters);
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan1");
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCreateLoan2");
    try {
        QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "free text");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "free text1");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "07/02/2011");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "20");
        questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].values", "three");
        questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "free text2");
        CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
        createQuestionParameters.setType(createQuestionParameters.TYPE_FREE_TEXT);
        createQuestionParameters.setText("questionByVerifyResponsesDuringCreationOfLoanAccount");
        List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
        newQuestionList.add(createQuestionParameters);
        String[] questionsExist = { "Date", "FreeText", "SingleSelect", "questionByVerifyResponsesDuringCreationOfLoanAccount" };
        String[] questionsInactive = { "ToBeDisabled" };
        Map<String, String> questionsAndAnswers = new HashMap<String, String>();
        questionsAndAnswers.put("MultiSelect", "three");
        questionsAndAnswers.put("Number", "20");
        questionsAndAnswers.put("Date", "04/02/2011");
        QuestionResponsePage questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, formParameters);
        questionResponsePage.populateAnswers(questionResponseParameters);
        CreateLoanAccountPreviewPage createLoanAccountPreviewPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage();
        verifyCreateLoanAccountPreviewPage();
        questionResponsePage = createLoanAccountPreviewPage.navigateToQuestionResponsePage();
        questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "blue");
        questionResponsePage.populateAnswers(questionResponseParameters);
        LoanAccountPage loanAccountPage = questionResponsePage.continueAndNavigateToCreateLoanAccountReviewInstallmentPage().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
        String loanID = loanAccountPage.getAccountId();
        verifyFees();
        ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
        viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
        viewQuestionResponseDetailPage.verifyQuestionPresent("ToBeDisabled", "free text");
        viewQuestionResponseDetailPage.verifyQuestionPresent("FreeText", "free text1");
        viewQuestionResponseDetailPage.verifyQuestionPresent("SingleSelect", "blue");
        viewQuestionResponseDetailPage.verifyQuestionPresent("DateQuestion", "07/02/2011");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
        viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Text", "free text2");
        questionGroupTestHelper.markQuestionAsInactive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
        questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateLoan1", newQuestionList);
        questionResponsePage = questionGroupTestHelper.navigateToQuestionResponsePageDuringLoanCreation(createLoanAccountSearchParameters, null);
        questionResponsePage.verifyQuestionsExists(questionsExist);
        questionResponsePage.verifyQuestionsDoesnotappear(questionsInactive);
        viewQuestionResponseDetailPage = questionGroupTestHelper.navigateToLoanViewQuestionResponseDetailPage(loanID);
        viewQuestionResponseDetailPage.verifyQuestionPresent("MultiSelect", "three");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Number", "20");
        viewQuestionResponseDetailPage.verifyQuestionPresent("Date", "04/02/2011");
        verifyQuestionResponsesExistInDatabase(loanID, "Create Loan", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionAsActive("ToBeDisabled");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan1");
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateLoan2");
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 9 with ViewQuestionResponseDetailPage

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

the class QuestionGroupTest method attachingQuestionGroupToMultipleFlowsTest.

/**
     * Attaching a Question Group to Multiple flows
     * http://mifosforge.jira.com/browse/MIFOSTEST-701
     *
     * @throws Exception
     */
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void attachingQuestionGroupToMultipleFlowsTest() throws Exception {
    String newClient = "Joe701 Doe701";
    questionGroupTestHelper.markQuestionGroupAsInactive("CreateOffice");
    createClient("Joe701", "Doe701");
    //When
    testValidationAddQuestionGroup();
    Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
    List<String> questions = new ArrayList<String>();
    questions.add("Date");
    questions.add("Number");
    questions.add("Text");
    sectionQuestions.put("Sec Test", questions);
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    String testQuestionGroup = "TestQuestionGroup";
    createQuestionGroupParameters.setTitle(testQuestionGroup);
    createQuestionGroupParameters.setAppliesTo("View Client");
    createQuestionGroupParameters.setAppliesTo("Close Client");
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    try {
        questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
        Map<String, String> answers = new HashMap<String, String>();
        answers.put("Text", "Test - Text");
        answers.put("Number", "2");
        answers.put("Date", "11/11/2009");
        ClientViewDetailsPage clientViewDetailsPage = questionGroupTestHelper.attachQuestionGroup(newClient, testQuestionGroup, asList("Sec Test"), answers);
        CustomerChangeStatusPage customerChangeStatusPage = clientViewDetailsPage.navigateToCustomerChangeStatusPage();
        EditCustomerStatusParameters customerStatusParameters = new EditCustomerStatusParameters();
        customerStatusParameters.setNote("TEST");
        customerStatusParameters.setClientStatus(ClientStatus.CLOSED);
        customerStatusParameters.setClientCloseReason(ClientCloseReason.TRANSFERRED);
        QuestionResponsePage questionResponsePage = customerChangeStatusPage.changeStatusAndNavigateToQuestionResponsePage(customerStatusParameters);
        //Then
        questionResponsePage.verifyQuestionsExists(questions.toArray(new String[questions.size()]));
        //When
        clientViewDetailsPage = questionResponsePage.cancel();
        ViewQuestionResponseDetailPage viewQuestionResponseDetailPage = clientViewDetailsPage.navigateToViewAdditionalInformationPage();
        //Then
        viewQuestionResponseDetailPage.verifyQuestionsDoesnotappear(questions.toArray(new String[questions.size()]));
        clientViewDetailsPage = viewQuestionResponseDetailPage.navigateToClientViewDetailsPage();
        answers = new HashMap<String, String>();
        answers.put("Text", "Test - Text - Edit");
        answers.put("Number", "22");
        questionGroupInstancesOfClient = clientViewDetailsPage.getQuestionGroupInstances();
        questionGroupTestHelper.editResponses(clientViewDetailsPage, latestInstanceId(questionGroupInstancesOfClient), answers);
        // extension MIFOS-5821
        CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
        searchParameters.setSearchString("Client - Mary Monthly");
        searchParameters.setLoanProduct("MonthlyClientFlatLoanThirdFridayOfMonth");
        loanTestHelper.createDefaultLoanAccount(searchParameters);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive(testQuestionGroup);
        questionGroupTestHelper.markQuestionGroupAsInactive("CreateOffice");
    }
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) List(java.util.List) ArrayList(java.util.ArrayList) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) Test(org.testng.annotations.Test)

Example 10 with ViewQuestionResponseDetailPage

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

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