Search in sources :

Example 1 with CancelReason

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

the class ClientTest method changeClientStatusAndVerifyBlacklistedFlag.

//http://mifosforge.jira.com/browse/MIFOS-4643
/**
     * Creates new client, tests status changes and verifies blacklisted flag.
     * @see http://mifosforge.jira.com/browse/MIFOS-4643
     */
@Test(enabled = true)
public void changeClientStatusAndVerifyBlacklistedFlag() {
    //Constant values
    String STATUS_PENDING_APPROVAL = "Application Pending Approval";
    int numberOfBlackFlags = 1;
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    //verify new client's status
    clientDetailsPage.verifyStatus(STATUS_PENDING_APPROVAL);
    //change client status to PARTIAL APPLICATION and check
    clientDetailsPage = changeClientStatusToPartialAndVerify(clientDetailsPage);
    //change client status to CANCELED with reason REJECTED and check
    clientDetailsPage = changeClientStatusToCancelWithReason("CancelWithReasonRejected", CancelReason.CLIENT_REJECTED, clientDetailsPage);
    clientDetailsPage.verifyCancellationReason(CancelReason.CLIENT_REJECTED.getPurposeText());
    //change client status to PARTIAL APPLICATION again and check
    clientDetailsPage = changeClientStatusToPartialAndVerify(clientDetailsPage);
    //change client status to CANCELED with reason BLACKLISTED and check for text and flag image
    clientDetailsPage = changeClientStatusToCancelWithReason("CancelWithReasonBlacklisted", CancelReason.CLIENT_BLACKLISTED, clientDetailsPage);
    clientDetailsPage.verifyCancellationReason(CancelReason.CLIENT_BLACKLISTED.getPurposeText());
    clientDetailsPage.verifyElementExistence("viewClientDetails.img.blackFlag");
    //next is sequence of status changing and verifying that there is always one and only one blackflag image
    CancelReason[] reasonArray = { CancelReason.CLIENT_REJECTED, CancelReason.CLIENT_DUPLICATE, CancelReason.CLIENT_OTHER, CancelReason.CLIENT_WITHDRAW, CancelReason.CLIENT_BLACKLISTED };
    for (CancelReason cancelReason : reasonArray) {
        clientDetailsPage = changeBackToPartialApplication(numberOfBlackFlags, clientDetailsPage);
        clientDetailsPage = changeClientStatusToCancelWithReason("CancelWithBlackFlag", cancelReason, clientDetailsPage);
        clientDetailsPage.verifyNumberOfBlackflags(numberOfBlackFlags);
    }
}
Also used : CancelReason(org.mifos.test.acceptance.framework.group.CancelReason) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) Test(org.testng.annotations.Test)

Example 2 with CancelReason

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

Aggregations

CancelReason (org.mifos.test.acceptance.framework.group.CancelReason)2 Test (org.testng.annotations.Test)2 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)1 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)1 EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)1 GroupViewDetailsPage (org.mifos.test.acceptance.framework.group.GroupViewDetailsPage)1