Search in sources :

Example 1 with QuestionGroupResponsePage

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");
}
Also used : QuestionGroupResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)

Example 2 with QuestionGroupResponsePage

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");
    }
}
Also used : QuestionGroupResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)

Example 3 with QuestionGroupResponsePage

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();
}
Also used : QuestionGroupResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage)

Example 4 with QuestionGroupResponsePage

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;
}
Also used : QuestionGroupResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) MifosPage(org.mifos.test.acceptance.framework.MifosPage)

Aggregations

QuestionGroupResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage)4 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)3 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)3 MifosPage (org.mifos.test.acceptance.framework.MifosPage)1