Search in sources :

Example 6 with EditCustomerStatusParameters

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

the class ClientTest method checkPermissionToEditClientInPendingApprovalState.

@Test(enabled = true)
public void checkPermissionToEditClientInPendingApprovalState() {
    String firstName = "Edit";
    String lastName = "Permission";
    DefineHiddenMandatoryFieldsPage mandatoryFieldsPage = navigationHelper.navigateToAdminPage().navigateToDefineHiddenMandatoryFields();
    mandatoryFieldsPage.uncheckMandatoryCitizenShip();
    mandatoryFieldsPage.uncheckMandatoryEthnicity();
    mandatoryFieldsPage.uncheckMandatoryMaritalStatus();
    mandatoryFieldsPage.submit();
    CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
    clientParams.setFirstName(firstName);
    clientParams.setLastName(lastName);
    ClientViewDetailsPage clientPage = clientTestHelper.createNewClient("group1", clientParams);
    clientPage.editPersonalInformation().submitAndNavigateToViewDetailsPage(clientParams);
    CustomerChangeStatusPage changeStatusPage = clientPage.navigateToCustomerChangeStatusPage();
    EditCustomerStatusParameters parameters = new EditCustomerStatusParameters();
    parameters.setClientStatus(ClientStatus.PARTIAL);
    parameters.setNote("test");
    changeStatusPage.setChangeStatusParametersAndSubmit(parameters);
    ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("3");
    manageRolePage.enablePermission("3_0_0");
    manageRolePage.enablePermission("3_0_2");
    manageRolePage.enablePermission("3_0_3");
    manageRolePage.submitAndGotoViewRolesPage();
    HomePage homePage = navigationHelper.navigateToHomePage();
    SearchResultsPage searchResultsPage = homePage.search(firstName + " " + lastName);
    ClientViewDetailsPage viewDetailsPage = searchResultsPage.navigateToClientViewDetailsPage("link=" + firstName + " " + lastName + "*");
    Assert.assertTrue(viewDetailsPage.editPersonalInformation().isAccessDeniedDisplayed());
    manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("3");
    manageRolePage.submitAndGotoViewRolesPage();
}
Also used : ClientSearchResultsPage(org.mifos.test.acceptance.framework.client.ClientSearchResultsPage) SearchResultsPage(org.mifos.test.acceptance.framework.search.SearchResultsPage) ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) HomePage(org.mifos.test.acceptance.framework.HomePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Example 7 with EditCustomerStatusParameters

use of org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters 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 8 with EditCustomerStatusParameters

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

the class ClientTest method removeClientFromBlacklistTest.

@Test(enabled = true)
public void removeClientFromBlacklistTest() {
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    String clientName = clientDetailsPage.getHeading();
    clientTestHelper.activateClient(clientName);
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setClientCloseReason(ClientCloseReason.BLACKLISTED);
    editCustomerStatusParameters.setClientStatus(ClientStatus.CLOSED);
    editCustomerStatusParameters.setNote("Adding Client to blacklist");
    clientTestHelper.changeCustomerStatus(clientName, editCustomerStatusParameters);
    clientDetailsPage.verifyCancellationReason(ClientCloseReason.BLACKLISTED.getPurposeText());
    clientDetailsPage.verifyElementExistence("viewClientDetails.img.blackFlag");
    clientTestHelper.activateClient(clientName);
    Assert.assertFalse(selenium.isTextPresent("Blacklisted"));
    Assert.assertFalse(selenium.isElementPresent("viewClientDetails.img.blackFlag"));
    Assert.assertFalse(selenium.isTextPresent("Blacklisted"));
    clientDetailsPage.verifyStatus(ClientTestHelper.ACTIVE);
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) Test(org.testng.annotations.Test)

Example 9 with EditCustomerStatusParameters

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

the class ClientTest method searchClientAndEditExistingClientDetails.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// http://mifosforge.jira.com/browse/MIFOSTEST-310
@Test(enabled = true)
public void searchClientAndEditExistingClientDetails() throws Exception {
    HomePage homePage = navigationHelper.navigateToHomePage();
    homePage = searchForClient("client1 lastname", homePage, 1);
    homePage = searchForClient("zzz", homePage, 0);
    SearchResultsPage searchResultsPage = homePage.search("client1 lastname");
    searchResultsPage.verifyPage();
    int numResults = searchResultsPage.countSearchResults();
    Assert.assertEquals(numResults, 1);
    ClientViewDetailsPage viewDetailsPage = searchResultsPage.navigateToClientViewDetailsPage("link=client1 lastname*");
    ClientNotesPage notesPage = viewDetailsPage.navigateToNotesPage();
    notesPage.addNotePreviewAndSubmit("test note");
    viewDetailsPage.verifyNotes("test note");
    CustomerChangeStatusPage changeStatusPage = viewDetailsPage.navigateToCustomerChangeStatusPage();
    EditCustomerStatusParameters parameters = new EditCustomerStatusParameters();
    parameters.setClientStatus(ClientStatus.ON_HOLD);
    parameters.setNote("test");
    CustomerChangeStatusPreviewPage changeStatusPreviewPage = changeStatusPage.setChangeStatusParametersAndSubmit(parameters);
    viewDetailsPage = changeStatusPreviewPage.submitAndGotoClientViewDetailsPage();
    viewDetailsPage.verifyStatus("On Hold");
    ClientEditPersonalInfoPage editPersonalInfoPage = viewDetailsPage.editPersonalInformation();
    CreateClientEnterPersonalDataPage.SubmitFormParameters parameters2 = new CreateClientEnterPersonalDataPage.SubmitFormParameters();
    parameters2.setSpouseFirstName("FatherFirstnameTest");
    parameters2.setSpouseLastName("FatherLastNameTest");
    parameters2.setSpouseNameType(CreateClientEnterPersonalDataPage.SubmitFormParameters.FATHER);
    parameters2.setDateOfBirthYYYY("1960");
    parameters2.setDateOfBirthMM("08");
    parameters2.setDateOfBirthDD("01");
    viewDetailsPage = editPersonalInfoPage.submitAndNavigateToViewDetailsPage(parameters2);
    viewDetailsPage.verifySpouseFather("FatherFirstnameTest FatherLastNameTest");
    ClientNotesPage seeAllNotes = viewDetailsPage.navigateToAllNotesPage();
    seeAllNotes.verifySeeAllNotesTitle("client1 lastname");
    // extension to verify MIFOS-5685
    applicationDatabaseOperation.updateGLIM(1);
    applicationDatabaseOperation.updateLSIM(1);
    seeAllNotes.navigateBack();
    editPersonalInfoPage = viewDetailsPage.editPersonalInformation();
    parameters2.setDateOfBirthYYYY("1961");
    parameters2.setDateOfBirthMM("07");
    parameters2.setDateOfBirthDD("02");
    viewDetailsPage = editPersonalInfoPage.submitAndNavigateToViewDetailsPage(parameters2);
    viewDetailsPage.verifyDateOfBirth("02", "07", "1961");
    seeAllNotes = viewDetailsPage.navigateToAllNotesPage();
    seeAllNotes.verifySeeAllNotesTitle("client1 lastname");
    applicationDatabaseOperation.updateGLIM(0);
    applicationDatabaseOperation.updateLSIM(0);
}
Also used : ClientSearchResultsPage(org.mifos.test.acceptance.framework.client.ClientSearchResultsPage) SearchResultsPage(org.mifos.test.acceptance.framework.search.SearchResultsPage) HomePage(org.mifos.test.acceptance.framework.HomePage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) ClientNotesPage(org.mifos.test.acceptance.framework.client.ClientNotesPage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.admin.FeesCreatePage.SubmitFormParameters) ClientEditPersonalInfoPage(org.mifos.test.acceptance.framework.client.ClientEditPersonalInfoPage) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage) Test(org.testng.annotations.Test)

Example 10 with EditCustomerStatusParameters

use of org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters 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)

Aggregations

EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)20 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)11 Test (org.testng.annotations.Test)10 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)9 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)7 CustomerChangeStatusPreviewPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)6 GroupViewDetailsPage (org.mifos.test.acceptance.framework.group.GroupViewDetailsPage)4 HomePage (org.mifos.test.acceptance.framework.HomePage)2 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)2 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)2 CreateGroupConfirmationPage (org.mifos.test.acceptance.framework.group.CreateGroupConfirmationPage)2 CreateGroupEntryPage (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage)2 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)2 SearchResultsPage (org.mifos.test.acceptance.framework.search.SearchResultsPage)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.admin.FeesCreatePage.SubmitFormParameters)1 ManageRolePage (org.mifos.test.acceptance.framework.admin.ManageRolePage)1