Search in sources :

Example 1 with QuestionResponseParameters

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

the class CreateClientLoanAccountTest method newWeeklyClientLoanAccountWithQuestionGroups.

@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui", "smoke", "no_db_unit" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyClientLoanAccountWithQuestionGroups() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "DT_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    String answer = "01/01/2010";
    String choiceAnswer = "Choice2";
    questionGroupHelper.createQuestionGroup(questionGroupTitle, question1, question2, "Create Loan");
    loanProductTestHelper.editLoanProductIncludeQuestionsGroups("Flat Interest Loan Product With Fee", questionGroupTitle);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("client1 lastname");
    searchParameters.setLoanProduct("Flat Interest Loan Product With Fee");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1012.0");
    QuestionResponseParameters parameters = new QuestionResponseParameters();
    parameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", answer);
    parameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", choiceAnswer);
    LoanAccountPage loanAccountPage = createLoanAccount(searchParameters, submitAccountParameters, parameters);
    ViewQuestionResponseDetailPage questionResponseDetailPage = loanAccountPage.navigateToAdditionalInformationPage();
    questionResponseDetailPage.verifyPage();
    questionResponseDetailPage.verifyQuestionPresent(question1, answer);
    questionResponseDetailPage.verifyQuestionPresent(question2, choiceAnswer);
    questionResponseDetailPage.navigateToDetailsPage();
    questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 2 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 3 with QuestionResponseParameters

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

the class ClientTest method createClientWithQuestionGroups.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// http://mifosforge.jira.com/browse/MIFOSTEST-681
@Test(enabled = true)
public void createClientWithQuestionGroups() throws Exception {
    createQuestions();
    CreateQuestionGroupParameters qg = questionGroupTestHelper.getCreateQuestionGroupParameters("CreateClientQG", asList("q1", "q2", "q3"), "Create Client", "Sec 1");
    questionGroupTestHelper.createQuestionGroup(qg);
    CreateQuestionGroupParameters qg2 = questionGroupTestHelper.getCreateQuestionGroupParameters("CreateClientQG2", asList("q6"), "Create Client", "Sec 2");
    questionGroupTestHelper.createQuestionGroup(qg2);
    CreateClientEnterPersonalDataPage.SubmitFormParameters formParameters = createFormParameters();
    QuestionResponseParameters responseParams = new QuestionResponseParameters();
    responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "yes");
    responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "good");
    responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "qwer");
    // When
    clientTestHelper.createClientWithQuestionGroups(formParameters, "group1", responseParams);
    List<String> questionToAdd = new ArrayList<String>();
    questionToAdd.add("q4");
    questionToAdd.add("q5");
    List<String> questionToDeactivate = new ArrayList<String>();
    questionToDeactivate.add("q6");
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    for (String question : questionToAdd) {
        createQuestionGroupParameters.addExistingQuestion("Sec 1", question);
    }
    questionGroupTestHelper.addQuestionsToQuestionGroup("CreateClientQG", createQuestionGroupParameters.getExistingQuestions());
    for (String question : questionToDeactivate) {
        questionGroupTestHelper.markQuestionAsInactive(question);
    }
    questionGroupTestHelper.markQuestionGroupAsInactive("CreateClientQG2");
    QuestionResponsePage questionResponsePage = clientTestHelper.navigateToQuestionResponsePage(formParameters, "group1");
    // Then
    questionResponsePage.verifyQuestionsDoesnotappear(questionToDeactivate.toArray(new String[questionToDeactivate.size()]));
    questionResponsePage.verifyQuestionsExists(questionToAdd.toArray(new String[questionToAdd.size()]));
    questionResponsePage.verifySectionDoesnotappear("Sec 2");
    questionGroupTestHelper.markQuestionGroupAsInactive("CreateClientQG");
}
Also used : CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) Test(org.testng.annotations.Test)

Example 4 with QuestionResponseParameters

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

the class CenterTest method getQuestionResponseParameters.

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

Example 5 with QuestionResponseParameters

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

the class QuestionGroupSavingsAccountTest method verifyCapturingResponsesDuringSavingsCreation.

//http://mifosforge.jira.com/browse/MIFOSTEST-669
/*
     * need to fix up commonality between questionaire pages for loan and savings.
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void verifyCapturingResponsesDuringSavingsCreation() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 28, 15, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    setQuestionGroup();
    createClient("669");
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("Joe669 Doe669");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textquestion");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "100");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[2].value", "Text");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[0].questions[3].value", "blue");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].values", "two");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "6");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].values", "one");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "123");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "7");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "Text");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "red");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[2].questions[0].value", "Text");
    QuestionResponseParameters questionResponseParameters2 = new QuestionResponseParameters();
    questionResponseParameters2.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textQuestion");
    questionResponseParameters2.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "9");
    savingsAccountHelper.fillQuestionGroupsDurringCreationSavingsAccount(searchParameters, submitAccountParameters, questionResponseParameters);
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.editAdditionalInformationDurringCreationSavingsAccount(questionResponseParameters2);
    String savingsId = savingsAccountDetailPage.getAccountId();
    questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount");
    questionGroupTestHelper.markQuestionAsInactive("SingleSelect");
    questionGroupTestHelper.markQuestionAsInactive("NumberBetween5And10");
    questionGroupTestHelper.markQuestionAsInactive("Question1");
    questionGroupTestHelper.markQuestionAsInactive("question 1");
    CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    createQuestionParameters.setText("newQuestion232");
    List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
    newQuestionList.add(createQuestionParameters);
    questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateSavingsAccount2", newQuestionList);
    Map<String, String> questionsAndAnswers = new HashMap<String, String>();
    questionsAndAnswers.put("MultiSelect", "two");
    questionsAndAnswers.put("Number", "100");
    questionsAndAnswers.put("FreeText", "textquestion");
    String[] questionsExist = { "newQuestion232", "MultiSelect", "Number", "FreeText" };
    String[] questionsInactive = { "SingleSelect", "NumberBetween5And10", "Question1", "question 1", "Date" };
    QuestionnairePage questionnairePage = savingsAccountHelper.navigateToQuestionResponseDuringCreateSavings(searchParameters, submitAccountParameters);
    questionnairePage.verifyQuestionsExists(questionsExist);
    questionnairePage.verifyQuestionsDoesnotappear(questionsInactive);
    verifyQuestionResponsesExistInDatabase(savingsId, "Create Savings", questionsAndAnswers);
    questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount2");
    questionGroupTestHelper.markQuestionAsActive("SingleSelect");
    questionGroupTestHelper.markQuestionAsActive("NumberBetween5And10");
    questionGroupTestHelper.markQuestionAsActive("Question1");
    questionGroupTestHelper.markQuestionAsActive("question 1");
}
Also used : HashMap(java.util.HashMap) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) Test(org.testng.annotations.Test)

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