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);
}
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);
}
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");
}
}
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");
}
}
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", "");
}
Aggregations