use of org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage in project head by mifos.
the class QuestionGroupTest method editResponses.
private void editResponses(ClientViewDetailsPage clientViewDetailsPage, int id, Map<String, String> answers) {
QuestionGroupResponsePage questionGroupResponsePage = clientViewDetailsPage.navigateToQuestionGroupResponsePage(id);
QuestionnairePage questionnairePage = questionGroupResponsePage.navigateToEditResponses();
for (String question : answers.keySet()) {
questionnairePage.setResponse(question, answers.get(question));
}
ClientViewDetailsPage clientViewDetailsPage2 = (ClientViewDetailsPage) questionnairePage.submit();
Assert.assertEquals(clientViewDetailsPage2.getQuestionGroupInstances().get(id).getName(), "TestQuestionGroup");
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage in project head by mifos.
the class QuestionGroupTestHelper method editResponses.
public void editResponses(ClientViewDetailsPage clientViewDetailsPage, int id, Map<String, String> answers) {
QuestionGroupResponsePage questionGroupResponsePage = clientViewDetailsPage.navigateToQuestionGroupResponsePage(id);
QuestionnairePage questionnairePage = questionGroupResponsePage.navigateToEditResponses();
for (String question : answers.keySet()) {
questionnairePage.setResponse(question, answers.get(question));
}
ClientViewDetailsPage clientViewDetailsPage2 = (ClientViewDetailsPage) questionnairePage.submit();
if (clientViewDetailsPage2 != null && clientViewDetailsPage2.getQuestionGroupInstances() != null && clientViewDetailsPage2.getQuestionGroupInstances().size() > 2) {
Assert.assertEquals(clientViewDetailsPage2.getQuestionGroupInstances().get(2).getName(), "TestQuestionGroup");
}
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage in project head by mifos.
the class ClientTest method verifyQuestionGroupResponse.
private void verifyQuestionGroupResponse(String response) {
QuestionGroupResponsePage questionGroupResponsePage = viewClientDetailsPage.navigateToQuestionGroupResponsePage(latestInstanceId(questionGroupInstancesOfClient));
questionGroupResponsePage.verifyPage();
String msg = response + " not found for question " + question1 + ". Instead found " + questionGroupResponsePage.getAnswerHtml(question1);
Assert.assertTrue(msg, questionGroupResponsePage.getAnswerHtml(question1).contains(response));
Assert.assertTrue(questionGroupResponsePage.getAnswerHtml(question2).contains("Choice1"));
Assert.assertTrue(questionGroupResponsePage.getAnswerHtml(question2).contains("Choice3"));
Assert.assertTrue(questionGroupResponsePage.getAnswerHtml(question2).contains("Choice4"));
viewClientDetailsPage = questionGroupResponsePage.navigateToViewClientDetailsPage();
}
use of org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage in project head by mifos.
the class ClientTest method testEditQuestionGroup.
private void testEditQuestionGroup(String answer) {
int instanceId = latestInstanceId(questionGroupInstancesOfClient);
QuestionGroupResponsePage questionGroupResponsePage = viewClientDetailsPage.navigateToQuestionGroupResponsePage(instanceId);
QuestionnairePage questionnairePage = questionGroupResponsePage.navigateToEditResponses();
verifyCancel(questionnairePage);
questionGroupResponsePage = viewClientDetailsPage.navigateToQuestionGroupResponsePage(instanceId);
questionnairePage = questionGroupResponsePage.navigateToEditResponses();
questionnairePage.setResponse(question1, answer);
MifosPage mifosPage = questionnairePage.submit();
Assert.assertTrue(mifosPage instanceof ClientViewDetailsPage);
ClientViewDetailsPage clientViewDetailsPage = (ClientViewDetailsPage) mifosPage;
viewClientDetailsPage = clientViewDetailsPage;
}
Aggregations