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);
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class QuestionGroupTest method getResponse.
private QuestionResponseParameters getResponse(String answer) {
QuestionResponseParameters initialResponse = new QuestionResponseParameters();
initialResponse.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", answer);
return initialResponse;
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters 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", "");
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class CenterTest method createCenterTest.
/**
* Capturing responses during the Center creation http://mifosforge.jira.com/browse/MIFOSTEST-665
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createCenterTest() throws Exception {
String officeName = "MyOfficeDHMFT";
String qG1Name = "CreateCenterQG";
String qG2Name = "CreateCenterQG2";
createQuestions();
CreateQuestionGroupParameters qG1 = questionTestHelper.getCreateQuestionGroupParameters(qG1Name, asList("center question 1", "center question 2", "center question 3"), "Create Center", "Sec 1");
questionTestHelper.createQuestionGroup(qG1);
CreateQuestionGroupParameters qG2 = questionTestHelper.getCreateQuestionGroupParameters(qG2Name, asList("center question 4", "center question 5", "center question 6"), "Create Center", "Sec 2");
questionTestHelper.createQuestionGroup(qG2);
String testCenterName = "Center" + StringUtil.getRandomString(6);
CreateCenterEnterDataPage.SubmitFormParameters centerParams = getCenterParameters(testCenterName, "loan officer");
QuestionResponseParameters responseParams = getQuestionResponseParameters("answer1");
QuestionResponseParameters responseParams2 = getQuestionResponseParameters("answer2");
List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
questionsList.add(newFreeTextQuestionParameters("new center question 1"));
questionsList.add(newFreeTextQuestionParameters("new center question 2"));
String[] newActiveQuestions = { "new center question 1", "center question 2" };
String[] deactivateArray = { "center question 3", "center question 4" };
List<String> deactivateList = Arrays.asList(deactivateArray);
CenterViewDetailsPage centerViewDetailsPage = centerTestHelper.createCenterWithQuestionGroupsEdited(centerParams, officeName, responseParams, responseParams2);
centerViewDetailsPage.navigateToViewAdditionalInformation().navigateBack();
questionTestHelper.addNewQuestionsToQuestionGroup(qG1Name, questionsList);
questionTestHelper.markQuestionsAsInactive(deactivateList);
questionTestHelper.markQuestionGroupAsInactive(qG2Name);
QuestionResponsePage responsePage = centerTestHelper.navigateToQuestionResponsePageWhenCreatingCenter(centerParams, officeName);
responsePage.verifyQuestionsDoesnotappear(deactivateArray);
responsePage.verifyQuestionsExists(newActiveQuestions);
centerViewDetailsPage = centerTestHelper.navigateToCenterViewDetailsPage(testCenterName);
centerViewDetailsPage.verifyActiveCenter(centerParams);
ViewQuestionResponseDetailPage responseDetailsPage = centerViewDetailsPage.navigateToViewAdditionalInformation();
responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
responseDetailsPage.verifyEditButtonDisabled("1");
QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
questionTestHelper.markQuestionGroupAsInactive(qG1Name);
}
use of org.mifos.test.acceptance.framework.loan.QuestionResponseParameters in project head by mifos.
the class ClientTest method getQuestionResponseParametersForClientAccountClose.
private QuestionResponseParameters getQuestionResponseParametersForClientAccountClose(String answer) {
QuestionResponseParameters responseParams = new QuestionResponseParameters();
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "24/01/2011");
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].valuesAsArray", "first");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "10");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "10");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[0].questions[4].value", answer);
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "good");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "24/01/2011");
responseParams.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[2].valuesAsArray", "feb");
responseParams.addTextAnswer("questionGroups[0].sectionDetails[1].questions[3].value", answer);
responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "24/01/2011");
responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "10");
responseParams.addTextAnswer("questionGroups[1].sectionDetails[0].questions[2].value", answer);
responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[0].questions[3].value", "good");
responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].value", "1");
responseParams.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", answer);
responseParams.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[2].valuesAsArray", "jan");
responseParams.addTextAnswer("questionGroups[1].sectionDetails[1].questions[3].value", answer);
return responseParams;
}
Aggregations