use of org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage 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");
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage in project head by mifos.
the class CreateLoanAccountEntryPage method populateCreateLoanQuestionResponsesIfNeeded.
private void populateCreateLoanQuestionResponsesIfNeeded(QuestionResponseParameters responseParameters, String pageId) {
if (StringUtils.equalsIgnoreCase(pageId, "captureQuestionResponse")) {
QuestionResponsePage responsePage = new QuestionResponsePage(selenium);
responsePage.populateAnswers(responseParameters);
responsePage.navigateToNextPage();
} else if ("Exception".equals(pageId)) {
String stackTrace = selenium.getText("css=div.stackTrace pre");
Assert.fail("Expected page <???>, actual page <" + pageId + ">!!! with exception stack > " + stackTrace);
} else if (getErrors().length() > 0) {
String errors = getErrors();
Assert.fail("Expected page <???>, actual page <" + pageId + ">!!! with error message > " + errors);
}
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage in project head by mifos.
the class CenterTestHelper method createCenterWithQuestionGroupsEdited.
public CenterViewDetailsPage createCenterWithQuestionGroupsEdited(CreateCenterEnterDataPage.SubmitFormParameters formParameters, String officeName, QuestionResponseParameters responseParams, QuestionResponseParameters responseParams2) {
QuestionResponsePage responsePage = navigationHelper.navigateToClientsAndAccountsPage().navigateToCreateNewCenterPage().selectOffice(officeName).submitAndNavigateToQuestionResponsePage(formParameters);
responsePage.populateAnswers(responseParams);
responsePage.navigateToNextPage();
new CreateCenterPreviewDataPage(selenium).navigateToEditQuestionResponsePage();
responsePage.populateAnswers(responseParams2);
responsePage.navigateToNextPage();
return new CreateCenterPreviewDataPage(selenium).submit().navigateToCenterViewDetailsPage();
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage in project head by mifos.
the class ClientTestHelper method closeClientWithQG.
public ClientViewDetailsPage closeClientWithQG(String clientName, QuestionResponseParameters responseParamsAfterModyfication) {
EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
editCustomerStatusParameters.setClientStatus(ClientStatus.CLOSED);
editCustomerStatusParameters.setClientCloseReason(ClientCloseReason.LEFT_PROGRAM);
editCustomerStatusParameters.setNote("Close client account");
ClientViewDetailsPage clientDetailsPage = navigationHelper.navigateToClientViewDetailsPage(clientName);
CustomerChangeStatusPage statusChangePage = clientDetailsPage.navigateToCustomerChangeStatusPage();
QuestionResponsePage questionResponsePage = statusChangePage.changeStatusAndNavigateToQuestionResponsePage(editCustomerStatusParameters);
questionResponsePage.populateAnswers(responseParamsAfterModyfication);
questionResponsePage.navigateToNextPage();
new CustomerChangeStatusPreviewPage(selenium).submitAndGotoClientViewDetailsPage();
return new ClientViewDetailsPage(selenium);
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage in project head by mifos.
the class GroupTestHelper method createGroupWithQuestionGroupsEdited.
public GroupViewDetailsPage createGroupWithQuestionGroupsEdited(CreateGroupSubmitParameters groupParams, String centerName, QuestionResponseParameters responseParams, QuestionResponseParameters responseParams2) {
QuestionResponsePage responsePage = navigateToCreateGroupEntryPage(centerName).submitAndNavigateToQuestionResponsePage(groupParams);
responsePage.populateAnswers(responseParams);
responsePage.navigateToNextPage();
new CreateGroupPreviewDataPage(selenium).navigateToEditQuestionResponsePage();
responsePage.populateAnswers(responseParams2);
responsePage.navigateToNextPage();
return new CreateGroupPreviewDataPage(selenium).submitForApproval().navigateToGroupDetailsPage();
}
Aggregations