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);
}
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);
}
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);
}
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);
}
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);
}
}
Aggregations