Search in sources :

Example 11 with ClientViewDetailsPage

use of org.mifos.test.acceptance.framework.client.ClientViewDetailsPage in project head by mifos.

the class ClientTest method verifyCustomerScheduleAfterMovingClientToGroupWithDifferentMeetingFrequency.

public void verifyCustomerScheduleAfterMovingClientToGroupWithDifferentMeetingFrequency() {
    //Given
    String startGroupName = "GroupWeekly";
    String destinationGroupName = "MonthlyGroup";
    String clientName = "DoeTest2";
    //define declining balance monthly loan product
    DefineNewLoanProductPage.SubmitFormParameters formParameters = FormParametersHelper.getMonthlyLoanProductParameters();
    navigationHelper.navigateToAdminPage().defineLoanProduct(formParameters);
    //client
    CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
    clientParams.setFirstName("John");
    clientParams.setLastName(clientName);
    ClientViewDetailsPage clientPage = clientTestHelper.createNewClient(startGroupName, clientParams);
    clientTestHelper.changeCustomerStatus(clientPage, ClientStatus.ACTIVE);
    //When
    CreateLoanAccountSearchParameters loanFormParameters = new CreateLoanAccountSearchParameters();
    loanFormParameters.setSearchString(clientName);
    loanFormParameters.setLoanProduct("productMonthly*");
    clientPage.navigateToEditRemoveGroupMembership().searchGroup(destinationGroupName).selectGroupToAdd(destinationGroupName).submitAddGroup().navigateToClientsAndAccountsPageUsingHeaderTab().navigateToCreateLoanAccountUsingLeftMenu().searchAndNavigateToCreateLoanAccountPage(loanFormParameters);
    //Then
    //get current month
    int currentMonth = targetTime.getMonthOfYear();
    //get disbursement month
    int disbursementMonth = Integer.parseInt(selenium.getValue("id=disbursementDateMM"));
    //check if its a last month
    if (currentMonth == 12) {
        currentMonth = 1;
    } else {
        currentMonth++;
    }
    Assert.assertEquals(currentMonth, disbursementMonth);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)

Example 12 with ClientViewDetailsPage

use of org.mifos.test.acceptance.framework.client.ClientViewDetailsPage in project head by mifos.

the class CollectionSheetEntryAttendanceTest method verifyMeetingAttendances.

private void verifyMeetingAttendances(String client, int attended, int missed) {
    ClientViewDetailsPage clientViewDetailsPage = navigationHelper.navigateToClientViewDetailsPage(client);
    clientViewDetailsPage.verifyMeetingsAttended(attended);
    clientViewDetailsPage.verifyMeetingsMissed(missed);
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)

Example 13 with ClientViewDetailsPage

use of org.mifos.test.acceptance.framework.client.ClientViewDetailsPage 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 14 with ClientViewDetailsPage

use of org.mifos.test.acceptance.framework.client.ClientViewDetailsPage 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 15 with ClientViewDetailsPage

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

Aggregations

ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)47 Test (org.testng.annotations.Test)17 EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)11 CreateClientEnterPersonalDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage)10 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)8 CustomerChangeStatusPreviewPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)6 QuestionnairePage (org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage)6 SubmitFormParameters (org.mifos.test.acceptance.framework.admin.FeesCreatePage.SubmitFormParameters)4 HomePage (org.mifos.test.acceptance.framework.HomePage)3 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)3 QuestionGroupResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionGroupResponsePage)3 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 DateTime (org.joda.time.DateTime)2 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)2 MifosPage (org.mifos.test.acceptance.framework.MifosPage)2 ClientViewChangeLogPage (org.mifos.test.acceptance.framework.client.ClientViewChangeLogPage)2 CreateClientEnterFamilyDetailsPage (org.mifos.test.acceptance.framework.client.CreateClientEnterFamilyDetailsPage)2 CreateClientEnterMfiDataPage (org.mifos.test.acceptance.framework.client.CreateClientEnterMfiDataPage)2