Search in sources :

Example 1 with CreateGroupSubmitParameters

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

the class ClientTest method prepareGroupsForAddClientsWithAccountsToGroups.

private void prepareGroupsForAddClientsWithAccountsToGroups(String groupInactiveAccountName, String groupActiveAccountName, Map<String, GroupViewDetailsPage> groups, String savingsProductNameForGroups) {
    String center = "Default Center";
    groups.put(groupInactiveAccountName, null);
    groups.put(groupActiveAccountName, null);
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    EditCustomerStatusParameters customerStatusParameters = new EditCustomerStatusParameters();
    customerStatusParameters.setNote("MIFOS-4272: activate groups");
    for (String groupKey : groups.keySet()) {
        groupParams.setGroupName(groupKey);
        groupTestHelper.createNewGroupPartialApplication(center, groupParams);
        customerStatusParameters.setGroupStatus(GroupStatus.PENDING_APPROVAL);
        groupTestHelper.changeGroupStatus(groupKey, customerStatusParameters);
        customerStatusParameters.setGroupStatus(GroupStatus.ACTIVE);
        groups.put(groupKey, groupTestHelper.changeGroupStatus(groupKey, customerStatusParameters));
    }
    addSavingsToCustomer(groupInactiveAccountName, false, savingsProductNameForGroups);
    addSavingsToCustomer(groupActiveAccountName, true, savingsProductNameForGroups);
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)

Example 2 with CreateGroupSubmitParameters

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

the class ClientTest method addingMemeberToGroupWithDiffrentStatuses.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void addingMemeberToGroupWithDiffrentStatuses() throws Exception {
    String clientName;
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName("testGroup" + StringUtil.getRandomString(5));
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setNote("change status");
    // When
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    clientName = clientDetailsPage.getHeading();
    clientTestHelper.changeCustomerStatus(clientDetailsPage, ClientStatus.ACTIVE);
    groupTestHelper.createNewGroupPartialApplication("Default Center", groupParams);
    // Then
    clientTestHelper.addClientToGroupWithErrorGroupLowerStatus(clientName, groupParams.getGroupName());
    // When
    editCustomerStatusParameters.setGroupStatus(GroupStatus.PENDING_APPROVAL);
    groupTestHelper.changeGroupStatus(groupParams.getGroupName(), editCustomerStatusParameters);
    // Then
    clientTestHelper.addClientToGroupWithErrorGroupLowerStatus(clientName, groupParams.getGroupName());
    // When
    editCustomerStatusParameters.setGroupStatus(GroupStatus.ACTIVE);
    groupTestHelper.changeGroupStatus(groupParams.getGroupName(), editCustomerStatusParameters);
    // Then
    clientTestHelper.addClientToGroup(clientName, groupParams.getGroupName());
    // When
    clientTestHelper.deleteClientGroupMembership(clientName, "remove group membership");
    editCustomerStatusParameters.setGroupStatus(GroupStatus.ON_HOLD);
    groupTestHelper.changeGroupStatus(groupParams.getGroupName(), editCustomerStatusParameters);
    // Then
    clientTestHelper.tryAddClientToClosedOrOnHoldGroup(clientName, groupParams.getGroupName());
    // When
    editCustomerStatusParameters.setGroupStatus(GroupStatus.CLOSED);
    editCustomerStatusParameters.setCloseReason(GroupCloseReason.DUPLICATE);
    groupTestHelper.changeGroupStatus(groupParams.getGroupName(), editCustomerStatusParameters);
    // Then
    clientTestHelper.tryAddClientToClosedOrOnHoldGroup(clientName, groupParams.getGroupName());
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) Test(org.testng.annotations.Test)

Example 3 with CreateGroupSubmitParameters

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

the class GroupTest method getGenericGroupFormParameters.

private CreateGroupSubmitParameters getGenericGroupFormParameters() {
    CreateGroupSubmitParameters formParameters = new CreateGroupSubmitParameters();
    formParameters.setGroupName("groupTest" + StringUtil.getRandomString(6));
    formParameters.setRecruitedBy("Bagonza Wilson");
    formParameters.setTrainedDateDay("25");
    formParameters.setTrainedDateMonth("03");
    formParameters.setTrainedDateYear("1999");
    formParameters.setExternalId("external12345");
    formParameters.setAddressOne("address one: 4321 Pine Street");
    formParameters.setAddressTwo("address two: P.O. Box 99");
    formParameters.setAddressThree("address three: suite 322");
    formParameters.setCity("Circuit City");
    formParameters.setState("Garden State");
    formParameters.setCountry("Elbonia");
    formParameters.setPostalCode("33AB3");
    formParameters.setTelephone("88855533322");
    return formParameters;
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)

Example 4 with CreateGroupSubmitParameters

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

the class GroupTest method createGroupInPendingApprovalStateTestWithSurveys.

@Test(singleThreaded = true, groups = { "smoke", "group", "acceptance", "ui", "no_db_unit" })
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void createGroupInPendingApprovalStateTestWithSurveys() throws Exception {
    QuestionGroupTestHelper questionGroupTestHelper = new QuestionGroupTestHelper(selenium);
    String questionGroupTitle = "QG1" + random.nextInt(100);
    String question1 = "Nu_" + random.nextInt(100);
    String question2 = "SS_" + random.nextInt(100);
    List<Choice> choices = asList(new Choice("Choice1", asList("Tag1", "Tag2")), new Choice("Choice2", asList("Tag3", "Tag4")));
    createQuestionGroupForCreateGroup(questionGroupTitle, question1, question2, choices);
    CreateGroupEntryPage groupEntryPage = loginAndNavigateToNewGroupPage();
    CreateGroupSubmitParameters formParameters = getGenericGroupFormParameters();
    QuestionResponsePage questionResponsePage = groupEntryPage.submitNewGroupAndNavigateToQuestionResponsePage(formParameters);
    questionResponsePage.verifyPage();
    questionResponsePage.verifyNumericBoundsValidation("name=questionGroups[0].sectionDetails[0].questions[0].value", "1000", 10, 100, question1);
    questionResponsePage.populateTextAnswer("name=questionGroups[0].sectionDetails[0].questions[0].value", "30");
    questionResponsePage.populateSmartSelect("txtListSearch", getChoiceTags());
    GroupViewDetailsPage groupViewDetailsPage = questionResponsePage.navigateToCreateGroupDetailsPage("Application Pending*");
    ViewQuestionResponseDetailPage responsePage = groupViewDetailsPage.navigateToViewAdditionalInformationPage();
    responsePage.verifyPage();
    responsePage.verifyQuestionPresent(question1, "30");
    responsePage.verifyQuestionPresent(question2, "Choice", "Choice2");
    responsePage.navigateToDetailsPage();
    questionGroupTestHelper.markQuestionGroupAsInactive(questionGroupTitle);
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) ViewQuestionResponseDetailPage(org.mifos.test.acceptance.framework.questionnaire.ViewQuestionResponseDetailPage) Choice(org.mifos.test.acceptance.framework.questionnaire.Choice) CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) CreateGroupEntryPage(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage) Test(org.testng.annotations.Test)

Example 5 with CreateGroupSubmitParameters

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

the class ClientTest method addingMemeberOnHoldStatusToGroupWithDiffrentStatuses.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void addingMemeberOnHoldStatusToGroupWithDiffrentStatuses() throws Exception {
    String groupName = "testGroup";
    String clientName = "test";
    CreateGroupSubmitParameters groupParams = new CreateGroupSubmitParameters();
    groupParams.setGroupName(groupName);
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setNote("change status");
    // When
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    clientTestHelper.changeCustomerStatus(clientDetailsPage, ClientStatus.ACTIVE);
    clientTestHelper.changeCustomerStatus(clientDetailsPage, ClientStatus.ON_HOLD);
    groupTestHelper.createNewGroupPartialApplication("Default Center", groupParams);
    // Then
    clientTestHelper.addClientToGroupWithErrorGroupLowerStatus(clientName, groupName);
    // When
    editCustomerStatusParameters.setGroupStatus(GroupStatus.PENDING_APPROVAL);
    groupTestHelper.changeGroupStatus(groupName, editCustomerStatusParameters);
    // Then
    clientTestHelper.addClientToGroupWithErrorGroupLowerStatus(clientName, groupName);
    // When
    editCustomerStatusParameters.setGroupStatus(GroupStatus.ACTIVE);
    groupTestHelper.changeGroupStatus(groupName, editCustomerStatusParameters);
    // Then
    clientTestHelper.addClientToGroup(clientName, groupName);
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) 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