Search in sources :

Example 6 with CreateGroupSubmitParameters

use of org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters in project head by mifos.

the class GroupTest method verifyPendingApprovalSetToDefault.

/**
     * Verify when Pending Approval (Groups) is set to default(true);
     * the system transitions the account to this state when creating new groups
     * http://mifosforge.jira.com/browse/MIFOSTEST-210
     *
     * @throws Exception
     */
@Test(groups = { "group", "acceptance", "ui", "no_db_unit" })
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyPendingApprovalSetToDefault() throws Exception {
    CreateGroupSubmitParameters groupParams = getGenericGroupFormParameters();
    String centerName = "WeeklyMeetingCenter";
    GroupViewDetailsPage groupViewDetailsPage = groupTestHelper.createNewGroup(centerName, groupParams);
    groupViewDetailsPage.verifyStatus(GroupViewDetailsPage.STATUS_PENDING_APPROVAL);
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) Test(org.testng.annotations.Test)

Example 7 with CreateGroupSubmitParameters

use of org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters in project head by mifos.

the class GroupTest method changeGroupStatusAndVerifyBlacklistedFlag.

//http://mifosforge.jira.com/browse/MIFOS-4643
/**
     * Creates new group, tests status changes and verifies blacklisted flag.
     * @see http://mifosforge.jira.com/browse/MIFOS-4643
     */
@Test(enabled = true, groups = { "group", "acceptance", "ui", "no_db_unit" })
public void changeGroupStatusAndVerifyBlacklistedFlag() {
    String groupStatusNote = "GROUP TEST FOR GROUP";
    String center = "Default Center";
    String fullGroupName = "testGroup" + StringUtil.getRandomString(8);
    //create test group
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName(fullGroupName);
    GroupViewDetailsPage detailsPage = groupTestHelper.createNewGroupPartialApplication(center, groupParams);
    //verify with starting status
    EditCustomerStatusParameters statusParameters = new EditCustomerStatusParameters();
    statusParameters.setGroupStatus(GroupStatus.PARTIAL);
    //note will be set only once
    statusParameters.setNote(groupStatusNote + fullGroupName);
    detailsPage.verifyStatus(statusParameters);
    //change status to Cancelled with reason Rejected and check
    changeStatusParameters(statusParameters, GroupStatus.CANCELLED, CancelReason.GROUP_REJECTED);
    detailsPage = changeGroupStatusToCancelled(fullGroupName, statusParameters);
    detailsPage.verifyStatus(statusParameters);
    //change status back to Partial Application and verify
    detailsPage = changeGroupStatusBackToPartial(fullGroupName, statusParameters);
    detailsPage.verifyStatus(statusParameters);
    //change status to Cancelled with Reason blacklisted
    changeStatusParameters(statusParameters, GroupStatus.CANCELLED, CancelReason.GROUP_BLACKLISTED);
    detailsPage = changeGroupStatusToCancelledAndVerifyFlag(fullGroupName, statusParameters);
    //sequence of setting group status to partial, verifying blackflag, changing status to cancelled and verifying again
    CancelReason[] reasonArray = { CancelReason.GROUP_DUPLICATE, CancelReason.GROUP_OTHER, CancelReason.GROUP_REJECTED, CancelReason.GROUP_WITHDRAW, CancelReason.GROUP_BLACKLISTED };
    for (CancelReason cancelReason : reasonArray) {
        detailsPage = changeGroupStatusToPartialAndVerifyFlag(fullGroupName, statusParameters);
        changeStatusParameters(statusParameters, GroupStatus.CANCELLED, cancelReason);
        changeGroupStatusToCancelledAndVerifyFlag(fullGroupName, statusParameters);
    }
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) CancelReason(org.mifos.test.acceptance.framework.group.CancelReason) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) Test(org.testng.annotations.Test)

Example 8 with CreateGroupSubmitParameters

use of org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters in project head by mifos.

the class GroupTest method createGroupWithQuestionGroup.

@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" }, enabled = true)
// https://mifosforge.jira.com/browse/MIFOS-5850
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createGroupWithQuestionGroup() throws Exception {
    //Given
    CreateQuestionGroupParameters questionGroupParams = new CreateQuestionGroupParameters();
    questionGroupParams.setTitle("CreateGroupQG");
    questionGroupParams.setAppliesTo("Create Group");
    questionGroupParams.setAnswerEditable(true);
    questionGroupParams.addExistingQuestion("Sec 1", "Date");
    questionGroupParams.addExistingQuestion("Sec 1", "ToBeDisabled");
    questionGroupParams.addExistingQuestion("Sec 2", "FreeText");
    questionGroupParams.addExistingQuestion("Sec 2", "SingleSelect");
    questionGroupTestHelper.createQuestionGroup(questionGroupParams);
    CreateQuestionGroupParameters questionGroupParams2 = new CreateQuestionGroupParameters();
    questionGroupParams2.setTitle("CreateGroupQG2");
    questionGroupParams2.setAppliesTo("Create Group");
    questionGroupParams2.setAnswerEditable(true);
    questionGroupParams2.addExistingQuestion("Sec 1", "DateQuestion");
    questionGroupParams2.addExistingQuestion("Sec 1", "Number");
    questionGroupParams2.addExistingQuestion("Sec 2", "MultiSelect");
    questionGroupParams2.addExistingQuestion("Sec 2", "Text");
    questionGroupTestHelper.createQuestionGroup(questionGroupParams2);
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName("GroupTest");
    String centerName = "Default Center";
    String qG_1 = "CreateGroupQG";
    String qG_2 = "CreateGroupQG2";
    QuestionResponseParameters responseParams = getQuestionResponseParametersForGroupCreation("answer1");
    QuestionResponseParameters responseParams2 = getQuestionResponseParametersForGroupCreation("answer2");
    List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
    questionsList.add(newFreeTextQuestionParameters("new question 1"));
    questionsList.add(newFreeTextQuestionParameters("new question 2"));
    questionsList.add(newFreeTextQuestionParameters("new question 3"));
    String[] newActiveQuestions = { "new question 1", "new question 2" };
    String[] deactivateArray = { "new question 3", "SingleSelect", "ToBeDisabled" };
    String[] deactivatedGroupArray = { "MultiSelect", "DateQuestion" };
    List<String> deactivateList = Arrays.asList(deactivateArray);
    //When / Then
    GroupViewDetailsPage groupViewDetailsPage = groupTestHelper.createGroupWithQuestionGroupsEdited(groupParams, centerName, responseParams, responseParams2);
    groupViewDetailsPage.navigateToViewAdditionalInformationPage().navigateBack();
    QuestionGroupTestHelper questionTestHelper = new QuestionGroupTestHelper(selenium);
    questionTestHelper.addNewQuestionsToQuestionGroup(qG_1, questionsList);
    questionTestHelper.markQuestionsAsInactive(deactivateList);
    questionTestHelper.markQuestionGroupAsInactive(qG_2);
    QuestionResponsePage responsePage = groupTestHelper.navigateToQuestionResponsePageWhenCreatingGroup(groupParams, centerName);
    responsePage.verifyQuestionsDoesnotappear(deactivateArray);
    responsePage.verifyQuestionsDoesnotappear(deactivatedGroupArray);
    responsePage.verifyQuestionsExists(newActiveQuestions);
    groupViewDetailsPage = navigationHelper.navigateToGroupViewDetailsPage(groupParams.getGroupName());
    ViewQuestionResponseDetailPage responseDetailsPage = groupViewDetailsPage.navigateToViewAdditionalInformationPage();
    responseDetailsPage.verifyQuestionsDoesnotappear(deactivateArray);
    QuestionnairePage questionnairePage = responseDetailsPage.navigateToEditSection("0");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[0].value", "");
    questionnairePage.verifyField("details[0].sectionDetails[0].questions[1].value", "");
    questionGroupTestHelper.markQuestionGroupAsInactive(qG_1);
    questionTestHelper.markQuestionAsActive("SingleSelect");
    questionTestHelper.markQuestionAsActive("ToBeDisabled");
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) CreateQuestionGroupParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) Test(org.testng.annotations.Test)

Example 9 with CreateGroupSubmitParameters

use of org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters in project head by mifos.

the class GroupTest method createGroupInPendingApprovalStateTest.

@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" })
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-301
void createGroupInPendingApprovalStateTest() throws Exception {
    //When
    CreateGroupEntryPage groupEntryPage = loginAndNavigateToNewGroupPage();
    CreateGroupSubmitParameters formParameters = getGenericGroupFormParameters();
    CreateGroupConfirmationPage confirmationPage = groupEntryPage.submitNewGroupForApproval(formParameters);
    confirmationPage.verifyPage();
    GroupViewDetailsPage groupDetailsPage = confirmationPage.navigateToGroupDetailsPage();
    //Then
    groupDetailsPage.verifyStatus("Application Pending*");
    //When
    CustomerChangeStatusPage customerChangeStatusPage = groupDetailsPage.navigateToEditGroupStatusPage();
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setGroupStatus(GroupStatus.ACTIVE);
    editCustomerStatusParameters.setNote("test");
    CustomerChangeStatusPreviewPage customerChangeStatusPreviewPage = customerChangeStatusPage.setChangeStatusParametersAndSubmit(editCustomerStatusParameters);
    GroupViewDetailsPage detailsPage = customerChangeStatusPreviewPage.navigateToGroupDetailsPage();
    //Then
    detailsPage.verifyStatus("Active*");
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) CreateGroupEntryPage(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) CreateGroupConfirmationPage(org.mifos.test.acceptance.framework.group.CreateGroupConfirmationPage) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage) Test(org.testng.annotations.Test)

Example 10 with CreateGroupSubmitParameters

use of org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters in project head by mifos.

the class GroupTest method verifyAcceptedPaymentTypesForGroup.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// http://mifosforge.jira.com/browse/MIFOSTEST-247
@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" })
public void verifyAcceptedPaymentTypesForGroup() throws Exception {
    //When
    GroupTestHelper groupTestHelper = new GroupTestHelper(selenium);
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName("TestGroup123456");
    groupTestHelper.createNewGroup("Default Center", groupParams);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanFeesPaymentType(DefineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanFeesPaymentType(DefineAcceptedPaymentTypesPage.VOUCHER);
    ApplyPaymentPage applyPaymentPage = navigationHelper.navigateToGroupViewDetailsPage("TestGroup123456").navigateToViewGroupChargesDetailPage().navigateToApplyPayments();
    //Then
    applyPaymentPage.verifyModeOfPayments();
}
Also used : GroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.GroupTestHelper) QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) ApplyPaymentPage(org.mifos.test.acceptance.framework.loan.ApplyPaymentPage) CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) Test(org.testng.annotations.Test)

Aggregations

CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)15 Test (org.testng.annotations.Test)13 GroupViewDetailsPage (org.mifos.test.acceptance.framework.group.GroupViewDetailsPage)9 EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)7 CreateGroupEntryPage (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage)4 CreateGroupConfirmationPage (org.mifos.test.acceptance.framework.group.CreateGroupConfirmationPage)3 GroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.GroupTestHelper)3 QuestionGroupTestHelper (org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper)3 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)2 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)2 CustomerChangeStatusPreviewPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)2 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)2 ViewQuestionResponseDetailPage (org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage)2 ArrayList (java.util.ArrayList)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)1 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1 CreateMeetingPage (org.mifos.test.acceptance.framework.center.CreateMeetingPage)1 CreateClientEnterMfiDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterMfiDataPage)1 CancelReason (org.mifos.test.acceptance.framework.group.CancelReason)1