Search in sources :

Example 66 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTestHelper method createQuestions.

public void createQuestions(List<CreateQuestionParameters> questions) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionPage createQuestionPage = adminPage.navigateToCreateQuestionPage();
    for (CreateQuestionParameters question : questions) {
        createQuestionPage.addQuestion(question);
    }
    adminPage = createQuestionPage.submitQuestions();
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)

Example 67 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTestHelper method naviagateToEditQuestionGroup.

public EditQuestionGroupPage naviagateToEditQuestionGroup(int questionGroupId) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewAllQuestionGroupsPage allQuestionGroupsPage = adminPage.navigateToViewAllQuestionGroups();
    QuestionGroupDetailPage questionGroupDetailPage = allQuestionGroupsPage.navigateToQuestionGroupDetailPage(questionGroupId);
    return questionGroupDetailPage.navigateToEditPage();
}
Also used : ViewAllQuestionGroupsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionGroupsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) QuestionGroupDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionGroupDetailPage)

Example 68 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTestHelper method naviagateToEditQuestion.

private EditQuestionPage naviagateToEditQuestion(String question) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewAllQuestionsPage viewAllQuestionsPage = adminPage.navigateToViewAllQuestions();
    QuestionDetailPage questionDetailPage = viewAllQuestionsPage.navigateToQuestionDetail(question);
    return questionDetailPage.navigateToEditQuestionPage();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) QuestionDetailPage(org.mifos.test.acceptance.framework.questionnaire.QuestionDetailPage) ViewAllQuestionsPage(org.mifos.test.acceptance.framework.questionnaire.ViewAllQuestionsPage)

Example 69 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class QuestionGroupTestHelper method createQuestionGroup.

public void createQuestionGroup(CreateQuestionGroupParameters createQuestionGroupParameters) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateQuestionGroupPage createQuestionGroupPage = adminPage.navigateToCreateQuestionGroupPage();
    for (String section : createQuestionGroupParameters.getExistingQuestions().keySet()) {
        createQuestionGroupPage.addExistingQuestion(section, createQuestionGroupParameters.getExistingQuestions().get(section));
    }
    for (String section : createQuestionGroupParameters.getNewQuestions().keySet()) {
        createQuestionGroupPage.setSection(section);
        for (CreateQuestionParameters createQuestionParameters : createQuestionGroupParameters.getNewQuestions().get(section)) {
            createQuestionGroupPage.addNewQuestion(createQuestionParameters);
        }
    }
    createQuestionGroupPage.submit(createQuestionGroupParameters);
}
Also used : CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupPage(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)

Example 70 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class PersonnelTest method createUserWithQuestionGroup.

//http://mifosforge.jira.com/browse/MIFOSTEST-670
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createUserWithQuestionGroup() throws Exception {
    //Given
    createQuestions();
    //When
    Map<String, List<String>> sectionQuestions = new HashMap<String, List<String>>();
    List<String> questions = new ArrayList<String>();
    questions.add("user question 1");
    sectionQuestions.put("Sec 1", questions);
    questions = new ArrayList<String>();
    questions.add("user question 2");
    questions.add("user question 3");
    sectionQuestions.put("Sec 2", questions);
    CreateQuestionGroupParameters createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    createQuestionGroupParameters.setAppliesTo("Create Personnel");
    createQuestionGroupParameters.setTitle("Create Personnel QG1");
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
    sectionQuestions = new HashMap<String, List<String>>();
    questions = new ArrayList<String>();
    questions.add("user question 4");
    sectionQuestions.put("Sec 3", questions);
    createQuestionGroupParameters = new CreateQuestionGroupParameters();
    createQuestionGroupParameters.setAnswerEditable(true);
    createQuestionGroupParameters.setAppliesTo("Create Personnel");
    createQuestionGroupParameters.setTitle("Create Personnel QG2");
    createQuestionGroupParameters.setExistingQuestions(sectionQuestions);
    questionGroupTestHelper.createQuestionGroup(createQuestionGroupParameters);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    CreateUserParameters userParameters = adminPage.getAdminUserParameters();
    ChooseOfficePage createUserPage = adminPage.navigateToCreateUserPage();
    createUserPage.verifyPage();
    CreateUserEnterDataPage userEnterDataPage = createUserPage.selectOffice("MyOfficeDHMFT");
    QuestionResponsePage questionResponsePage = userEnterDataPage.submitAndNavigateToQuestionResponsePage(userParameters);
    questionResponsePage.verifyPage();
    QuestionResponseParameters responseParameters = new QuestionResponseParameters();
    responseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "yes");
    responseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "text1");
    questionResponsePage.populateAnswers(responseParameters);
    CreateUserPreviewDataPage createUserPreviewDataPage = questionResponsePage.continueAndNavigateToCreateUserPreviewPage();
    questionResponsePage = createUserPreviewDataPage.navigateToEditAdditionalInformation();
    questionResponsePage.populateTextAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "text2");
    createUserPreviewDataPage = questionResponsePage.continueAndNavigateToCreateUserPreviewPage();
    CreateUserConfirmationPage userConfirmationPage = createUserPreviewDataPage.submit();
    QuestionnairePage questionnairePage = userConfirmationPage.navigateToUserViewDetailsPage().navigateToQuestionnairePage();
    //Then
    questionnairePage.verifyRadioGroup("details[0].sectionDetails[0].questions[0].value", "yes", true);
    questionnairePage.verifyRadioGroup("details[0].sectionDetails[1].questions[0].value", "good", false);
    questionnairePage.verifyField("details[0].sectionDetails[1].questions[1].value", "text2");
    //When
    questionnairePage.typeText("details[0].sectionDetails[1].questions[1].value", "text3");
    questionnairePage.submitAndNavigateToPersonnalDetailsPage();
    List<String> questionToAdd = new ArrayList<String>();
    questionToAdd.add("user question 5");
    questionToAdd.add("user question 6");
    List<String> questionToDesactivate = new ArrayList<String>();
    questionToDesactivate.add("user question 1");
    questionToDesactivate.add("user question 2");
    questionToDesactivate.add("user question 3");
    createQuestionGroupParameters = new CreateQuestionGroupParameters();
    for (String question : questionToAdd) {
        createQuestionGroupParameters.addExistingQuestion("Sec 1", question);
    }
    questionGroupTestHelper.addQuestionsToQuestionGroup("Create Personnel QG1", createQuestionGroupParameters.getExistingQuestions());
    for (String question : questionToDesactivate) {
        questionGroupTestHelper.markQuestionAsInactive(question);
    }
    questionGroupTestHelper.markQuestionGroupAsInactive("Create Personnel QG2");
    adminPage = navigationHelper.navigateToAdminPage();
    userParameters = adminPage.getAdminUserParameters();
    createUserPage = adminPage.navigateToCreateUserPage();
    createUserPage.verifyPage();
    userEnterDataPage = createUserPage.selectOffice("MyOfficeDHMFT");
    questionResponsePage = userEnterDataPage.submitAndNavigateToQuestionResponsePage(userParameters);
    questionResponsePage.verifyPage();
    //Then
    questionResponsePage.verifyQuestionsDoesnotappear(questionToDesactivate.toArray(new String[questionToDesactivate.size()]));
    questionResponsePage.verifyQuestionsExists(questionToAdd.toArray(new String[questionToAdd.size()]));
    questionResponsePage.verifySectionDoesnotappear("Sec 2");
    questionGroupTestHelper.markQuestionGroupAsInactive("Create Personnel QG1");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) CreateUserEnterDataPage(org.mifos.test.acceptance.framework.user.CreateUserEnterDataPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) CreateUserConfirmationPage(org.mifos.test.acceptance.framework.user.CreateUserConfirmationPage) ChooseOfficePage(org.mifos.test.acceptance.framework.office.ChooseOfficePage) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateUserPreviewDataPage(org.mifos.test.acceptance.framework.user.CreateUserPreviewDataPage) CreateUserParameters(org.mifos.test.acceptance.framework.user.CreateUserParameters) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)87 Test (org.testng.annotations.Test)33 HomePage (org.mifos.test.acceptance.framework.HomePage)9 CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)8 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)7 CreateUserParameters (org.mifos.test.acceptance.framework.user.CreateUserParameters)7 DateTime (org.joda.time.DateTime)6 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)6 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)6 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)6 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)5 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)5 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)4 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)4 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)4 ViewLoanProductsPage (org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage)4