Search in sources :

Example 6 with AttachQuestionGroupParameters

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

the class QuestionGroupSavingsAccountTest method verifyAttachingQuestionGroupToSavingsAccount.

/**
     * Attaching a Question Group to a Savings Account and capturing responses
     * http://mifosforge.jira.com/browse/MIFOSTEST-659
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToSavingsAccount() throws Exception {
    //Given
    questionGroupTestHelper.markQuestionGroupAsActive("QGForViewSavings");
    try {
        AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
        attachParams.setTarget("000100000000059");
        attachParams.setQuestionGroupName("QGForViewSavings");
        attachParams.addTextResponse("DateQuestion", "09/02/2011");
        attachParams.addTextResponse("Number", "10");
        attachParams.addTextResponse("NumberBetween5And10", "6");
        AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
        attachErrorParams.setTarget("000100000000059");
        attachErrorParams.setQuestionGroupName("QGForViewSavings");
        attachErrorParams.addTextResponse("Number", "qwerty");
        attachErrorParams.addTextResponse("NumberBetween5And10", "qwerty");
        attachErrorParams.addError("Please specify DateQuestion");
        attachErrorParams.addError("Please specify a number for Number");
        attachErrorParams.addError("Please specify a number between 5 and 10 for NumberBetween5And10");
        //When
        questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToSavingsAccount(attachErrorParams);
        questionGroupTestHelper.attachQuestionGroupToSavingsAccount(attachParams);
        attachParams.addTextResponse("Number", "15");
        attachParams.addTextResponse("NumberBetween5And10", "10");
        //Then
        questionGroupTestHelper.editQuestionGroupResponsesInSavingsAccount(attachParams);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForViewSavings");
    }
}
Also used : AttachQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters)

Aggregations

AttachQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters)6 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)3 List (java.util.List)3 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)3 Test (org.testng.annotations.Test)3 File (java.io.File)1 ConfigurationLocator (org.mifos.framework.util.ConfigurationLocator)1 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)1 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)1