Search in sources :

Example 1 with AttachQuestionGroupParameters

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

the class QuestionGroupCenterTest method verifyAttachingQuestionGroupToCenter.

/**
     * Attaching a Question Group to View Center and capturing responses
     * http://mifosforge.jira.com/browse/MIFOSTEST-661
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToCenter() throws Exception {
    AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
    attachParams.setTarget("Default Center");
    attachParams.setQuestionGroupName("ViewCenterQG");
    attachParams.addTextResponse("Date", "09/02/2011");
    attachParams.addTextResponse("question 3", "25/02/2011");
    attachParams.addCheckResponse("question 4", "yes");
    attachParams.addTextResponse("DateQuestion", "19/02/2011");
    attachParams.addTextResponse("Number", "60");
    attachParams.addTextResponse("question 1", "tekst tekst");
    attachParams.addTextResponse("Text", "ale alo olu");
    AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
    attachErrorParams.setTarget("Default Center");
    attachErrorParams.setQuestionGroupName("ViewCenterQG");
    attachErrorParams.addTextResponse("question 3", "25/02/2011");
    attachErrorParams.addTextResponse("Number", "sdfsdf");
    attachErrorParams.addCheckResponse("question 4", "yes");
    attachErrorParams.addError("Please specify Date.");
    attachErrorParams.addError("Please specify a number for Number.");
    attachErrorParams.addError("Please specify Text.");
    questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToCenter(attachErrorParams);
    questionGroupTestHelper.attachQuestionGroupToCenter(attachParams);
    attachParams.addTextResponse("Number", "20");
    attachParams.addTextResponse("question 3", "21/02/2011");
    questionGroupTestHelper.editQuestionGroupResponsesInCenter(attachParams);
}
Also used : AttachQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters)

Example 2 with AttachQuestionGroupParameters

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

the class QuestionGroupTest method verifyAttachingQuestionGroupToGroup.

@Test(enabled = true)
//http://mifosforge.jira.com/browse/MIFOSTEST-660
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToGroup() throws Exception {
    Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
    List<String> questions = new ArrayList<String>();
    String title = "TestQuestionGroup" + StringUtil.getRandomString(6);
    questions.add("Date");
    questions.add("question 3");
    questions.add("question 4");
    sectionQuestions.put("Sec 1", questions);
    questions = new ArrayList<String>();
    questions.add("DateQuestion");
    questions.add("Number");
    questions.add("question 1");
    questions.add("Text");
    sectionQuestions.put("Sec 2", questions);
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    createQuestionGroupParameters.setAppliesTo("View Group");
    createQuestionGroupParameters.setTitle(title);
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
    attachParams.setTarget("Default Group");
    attachParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
    attachParams.addTextResponse("Date", "09/02/2011");
    attachParams.addCheckResponse("question 4", "yes");
    attachParams.addTextResponse("DateQuestion", "19/02/2011");
    attachParams.addTextResponse("question 3", "25/02/2011");
    attachParams.addTextResponse("Number", "60");
    attachParams.addTextResponse("question 1", "tekst tekst");
    attachParams.addTextResponse("Text", "ale alo olu");
    AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
    attachErrorParams.setTarget("Default Group");
    attachErrorParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
    attachErrorParams.addTextResponse("Number", "sdfsdf");
    attachErrorParams.addTextResponse("question 3", "25/02/2011");
    attachErrorParams.addCheckResponse("question 4", "yes");
    attachErrorParams.addError("Please specify a number for Number.");
    //When
    questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
    questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToGroup(attachErrorParams);
    questionGroupTestHelper.attachQuestionGroupToGroup(attachParams);
    attachParams.addTextResponse("Number", "20");
    attachParams.addTextResponse("question 3", "21/02/2011");
    //Then
    questionGroupTestHelper.editQuestionGroupResponsesInGroup(attachParams);
    questionGroupTestHelper.markQuestionGroupAsInactive(title);
}
Also used : CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) AttachQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters) Test(org.testng.annotations.Test)

Example 3 with AttachQuestionGroupParameters

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

the class QuestionGroupTest method verifyAttachingQuestionGroupToViewClient.

@Test(enabled = true)
//http://mifosforge.jira.com/browse/MIFOSTEST-680
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToViewClient() throws Exception {
    String title = "TestQuestionGroup" + StringUtil.getRandomString(6);
    try {
        Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
        List<String> questions = new ArrayList<String>();
        questions.add("Date");
        questions.add("question 4");
        questions.add("question 3");
        sectionQuestions.put("Sec 1", questions);
        questions = new ArrayList<String>();
        questions.add("Number");
        questions.add("DateQuestion");
        questions.add("question 1");
        questions.add("Text");
        sectionQuestions.put("Sec 2", questions);
        CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
        createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
        createQuestionGroupParameters.setAnswerEditable(true);
        createQuestionGroupParameters.setAppliesTo("View Client");
        createQuestionGroupParameters.setTitle(title);
        AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
        attachParams.setTarget("0002-000000003");
        attachParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
        attachParams.addTextResponse("Number", "60");
        attachParams.addTextResponse("question 1", "tekst tekst");
        attachParams.addCheckResponse("question 4", "yes");
        attachParams.addTextResponse("question 3", "25/02/2011");
        attachParams.addTextResponse("Date", "09/02/2011");
        attachParams.addTextResponse("DateQuestion", "19/02/2011");
        attachParams.addTextResponse("Text", "ale alo olu");
        AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
        attachErrorParams.setTarget("0002-000000003");
        attachErrorParams.addError("Please specify a number for Number.");
        attachErrorParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
        attachErrorParams.addTextResponse("Number", "sdfsdf");
        attachErrorParams.addCheckResponse("question 4", "yes");
        attachErrorParams.addTextResponse("question 3", "25/02/2011");
        //When
        questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
        questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToClient(attachErrorParams);
        questionGroupTestHelper.attachQuestionGroupToClient(attachParams);
        attachParams.addTextResponse("Number", "20");
        attachParams.addTextResponse("question 3", "21/02/2011");
        //Then
        questionGroupTestHelper.editQuestionGroupResponsesInClient(attachParams);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive(title);
    }
}
Also used : CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) AttachQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters) Test(org.testng.annotations.Test)

Example 4 with AttachQuestionGroupParameters

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

the class QuestionGroupTest method verifyAttachingQuestionGroupToLoan.

@Test(enabled = true)
//http://mifosforge.jira.com/browse/MIFOSTEST-662
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToLoan() throws Exception {
    String title = "TestQuestionGroup" + StringUtil.getRandomString(6);
    try {
        Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
        List<String> questions = new ArrayList<String>();
        questions.add("question 4");
        questions.add("question 3");
        questions.add("Date");
        sectionQuestions.put("Sec 1", questions);
        questions = new ArrayList<String>();
        questions.add("question 1");
        questions.add("Number");
        questions.add("DateQuestion");
        questions.add("Text");
        sectionQuestions.put("Sec 2", questions);
        CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
        createQuestionGroupParameters.setAppliesTo("View Loan");
        createQuestionGroupParameters.setAnswerEditable(true);
        createQuestionGroupParameters.setTitle(title);
        createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
        AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
        attachParams.setTarget("000100000000012");
        attachParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
        attachParams.addCheckResponse("question 4", "yes");
        attachParams.addTextResponse("Date", "09/02/2011");
        attachParams.addTextResponse("DateQuestion", "19/02/2011");
        attachParams.addTextResponse("question 3", "25/02/2011");
        attachParams.addTextResponse("question 1", "tekst tekst");
        attachParams.addTextResponse("Text", "ale alo olu");
        attachParams.addTextResponse("Number", "60");
        AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
        attachErrorParams.setTarget("000100000000012");
        attachErrorParams.setQuestionGroupName(createQuestionGroupParameters.getTitle());
        attachErrorParams.addError("Please specify a number for Number.");
        attachErrorParams.addTextResponse("Number", "sdfsdf");
        attachErrorParams.addTextResponse("question 3", "25/02/2011");
        attachErrorParams.addCheckResponse("question 4", "yes");
        //When
        questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
        questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToLoan(attachErrorParams);
        questionGroupTestHelper.attachQuestionGroupToLoan(attachParams);
        attachParams.addTextResponse("Number", "20");
        attachParams.addTextResponse("question 3", "21/02/2011");
        //Then
        questionGroupTestHelper.editQuestionGroupResponsesInLoan(attachParams);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive(title);
    }
}
Also used : CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) AttachQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters) Test(org.testng.annotations.Test)

Example 5 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