Search in sources :

Example 1 with CustomerChangeStatusPreviewPage

use of org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage in project head by mifos.

the class ClientTestHelper method closeClientWithQG.

public ClientViewDetailsPage closeClientWithQG(String clientName, QuestionResponseParameters responseParamsAfterModyfication) {
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setClientStatus(ClientStatus.CLOSED);
    editCustomerStatusParameters.setClientCloseReason(ClientCloseReason.LEFT_PROGRAM);
    editCustomerStatusParameters.setNote("Close client account");
    ClientViewDetailsPage clientDetailsPage = navigationHelper.navigateToClientViewDetailsPage(clientName);
    CustomerChangeStatusPage statusChangePage = clientDetailsPage.navigateToCustomerChangeStatusPage();
    QuestionResponsePage questionResponsePage = statusChangePage.changeStatusAndNavigateToQuestionResponsePage(editCustomerStatusParameters);
    questionResponsePage.populateAnswers(responseParamsAfterModyfication);
    questionResponsePage.navigateToNextPage();
    new CustomerChangeStatusPreviewPage(selenium).submitAndGotoClientViewDetailsPage();
    return new ClientViewDetailsPage(selenium);
}
Also used : QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)

Example 2 with CustomerChangeStatusPreviewPage

use of org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage in project head by mifos.

the class ClientTestHelper method changeCustomerStatus.

public ClientViewDetailsPage changeCustomerStatus(String clientName, EditCustomerStatusParameters editCustomerStatusParameters) {
    ClientViewDetailsPage clientDetailsPage = navigationHelper.navigateToClientViewDetailsPage(clientName);
    CustomerChangeStatusPage statusChangePage = clientDetailsPage.navigateToCustomerChangeStatusPage();
    CustomerChangeStatusPreviewPage statusPreviewPage = statusChangePage.setChangeStatusParametersAndSubmit(editCustomerStatusParameters);
    ClientViewDetailsPage newClientDetailsPage = statusPreviewPage.submitAndGotoClientViewDetailsPage();
    newClientDetailsPage.verifyStatus(editCustomerStatusParameters.getClientStatus().getStatusText());
    newClientDetailsPage.verifyNotes(editCustomerStatusParameters.getNote());
    return newClientDetailsPage;
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)

Example 3 with CustomerChangeStatusPreviewPage

use of org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage 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 4 with CustomerChangeStatusPreviewPage

use of org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage in project head by mifos.

the class ClientTest method closeClientAccountWithQG.

// http://mifosforge.jira.com/browse/MIFOSTEST-663
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void closeClientAccountWithQG() throws Exception {
    //Given
    String groupName = "group1";
    CreateClientEnterPersonalDataPage.SubmitFormParameters clientParams = clientParams();
    clientParams.setFirstName("John");
    clientParams.setLastName("Doe4321");
    ClientViewDetailsPage clientPage = clientTestHelper.createNewClient(groupName, clientParams);
    String clientName = clientPage.getGlobalCustNum();
    clientTestHelper.changeCustomerStatus(clientPage, ClientStatus.ACTIVE);
    createQuestions2();
    createQuestionGroup2();
    String qG_1 = "CloseClientQG";
    String qG_2 = "CloseClientQG2";
    QuestionResponseParameters responseParams = getQuestionResponseParametersForClientAccountClose("answer1");
    QuestionResponseParameters responseParams2 = getQuestionResponseParametersForClientAccountClose("answer2");
    QuestionResponseParameters responseParamsAfterModyfication = getQuestionResponseParametersForClientAccountCloseAfterModyfication("answer2");
    List<CreateQuestionParameters> questionsList = new ArrayList<CreateQuestionParameters>();
    questionsList.add(newFreeTextQuestionParameters("663new question 1"));
    questionsList.add(newFreeTextQuestionParameters("663new question 2"));
    questionsList.add(newFreeTextQuestionParameters("663new question 3"));
    String[] newActiveQuestions = { "663new question 1", "663new question 2" };
    String[] deactivateArray = { "663new question 3", question3, question6, question2, question5 };
    String[] deactivatedGroupArray = { question10, question11 };
    List<String> deactivateList = Arrays.asList(deactivateArray);
    Map<String, String> questionsAndAnswers = new HashMap<String, String>();
    questionsAndAnswers.put("663new question 1", "answer2");
    questionsAndAnswers.put("663new question 2", "answer2");
    questionsAndAnswers.put(question1, "24/01/2011");
    questionsAndAnswers.put(question4, "10");
    questionsAndAnswers.put(question7, "24/01/2011");
    questionsAndAnswers.put(question8, "jan");
    questionsAndAnswers.put(question9, "answer2");
    //When / Then
    QuestionResponsePage responsePage = clientTestHelper.navigateToQuestionResponsePageWhenCloseClientAccount(clientName);
    responsePage.populateAnswers(responseParams);
    responsePage.navigateToNextPage();
    responsePage = new CustomerChangeStatusPreviewPage(selenium).navigateToEditAdditionalInformation();
    responsePage.populateAnswers(responseParams2);
    responsePage.navigateToNextPage();
    new CustomerChangeStatusPreviewPage(selenium).cancelAndGotoClientViewDetailsPage();
    QuestionGroupTestHelper questionTestHelper = new QuestionGroupTestHelper(selenium);
    questionTestHelper.addNewQuestionsToQuestionGroup(qG_1, questionsList);
    questionTestHelper.markQuestionsAsInactive(deactivateList);
    questionTestHelper.markQuestionGroupAsInactive(qG_2);
    responsePage = clientTestHelper.navigateToQuestionResponsePageWhenCloseClientAccount(clientName);
    responsePage.verifyQuestionsDoesnotappear(deactivateArray);
    responsePage.verifyQuestionsDoesnotappear(deactivatedGroupArray);
    responsePage.verifyQuestionsExists(newActiveQuestions);
    clientTestHelper.closeClientWithQG(clientName, responseParamsAfterModyfication);
    verifyQuestionResponsesExistInDatabase(clientName, "Close Client", questionsAndAnswers);
    questionTestHelper.markQuestionsAsInactive(asList("663new question 1", "663new question 2", question1, question2, question4, question7, question8, question9, question10, question11));
    questionTestHelper.markQuestionGroupAsInactive(qG_1);
}
Also used : QuestionGroupTestHelper(org.mifos.test.acceptance.framework.testhelpers.QuestionGroupTestHelper) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) HashMap(java.util.HashMap) QuestionResponsePage(org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) ArrayList(java.util.ArrayList) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) Test(org.testng.annotations.Test)

Example 5 with CustomerChangeStatusPreviewPage

use of org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage in project head by mifos.

the class GroupTest method createGroupInPendingApprovalStateTest.

@Test(singleThreaded = true, groups = { "group", "acceptance", "ui", "no_db_unit" })
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-301
void createGroupInPendingApprovalStateTest() throws Exception {
    //When
    CreateGroupEntryPage groupEntryPage = loginAndNavigateToNewGroupPage();
    CreateGroupSubmitParameters formParameters = getGenericGroupFormParameters();
    CreateGroupConfirmationPage confirmationPage = groupEntryPage.submitNewGroupForApproval(formParameters);
    confirmationPage.verifyPage();
    GroupViewDetailsPage groupDetailsPage = confirmationPage.navigateToGroupDetailsPage();
    //Then
    groupDetailsPage.verifyStatus("Application Pending*");
    //When
    CustomerChangeStatusPage customerChangeStatusPage = groupDetailsPage.navigateToEditGroupStatusPage();
    EditCustomerStatusParameters editCustomerStatusParameters = new EditCustomerStatusParameters();
    editCustomerStatusParameters.setGroupStatus(GroupStatus.ACTIVE);
    editCustomerStatusParameters.setNote("test");
    CustomerChangeStatusPreviewPage customerChangeStatusPreviewPage = customerChangeStatusPage.setChangeStatusParametersAndSubmit(editCustomerStatusParameters);
    GroupViewDetailsPage detailsPage = customerChangeStatusPreviewPage.navigateToGroupDetailsPage();
    //Then
    detailsPage.verifyStatus("Active*");
}
Also used : CreateGroupSubmitParameters(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters) GroupViewDetailsPage(org.mifos.test.acceptance.framework.group.GroupViewDetailsPage) CreateGroupEntryPage(org.mifos.test.acceptance.framework.group.CreateGroupEntryPage) EditCustomerStatusParameters(org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters) CustomerChangeStatusPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage) CreateGroupConfirmationPage(org.mifos.test.acceptance.framework.group.CreateGroupConfirmationPage) CustomerChangeStatusPreviewPage(org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage) Test(org.testng.annotations.Test)

Aggregations

CustomerChangeStatusPreviewPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPreviewPage)8 CustomerChangeStatusPage (org.mifos.test.acceptance.framework.customer.CustomerChangeStatusPage)7 ClientViewDetailsPage (org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)6 EditCustomerStatusParameters (org.mifos.test.acceptance.framework.group.EditCustomerStatusParameters)6 Test (org.testng.annotations.Test)4 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 CreateGroupSubmitParameters (org.mifos.test.acceptance.framework.group.CreateGroupEntryPage.CreateGroupSubmitParameters)2 GroupViewDetailsPage (org.mifos.test.acceptance.framework.group.GroupViewDetailsPage)2 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HomePage (org.mifos.test.acceptance.framework.HomePage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.admin.FeesCreatePage.SubmitFormParameters)1 ClientEditPersonalInfoPage (org.mifos.test.acceptance.framework.client.ClientEditPersonalInfoPage)1 ClientNotesPage (org.mifos.test.acceptance.framework.client.ClientNotesPage)1 ClientSearchResultsPage (org.mifos.test.acceptance.framework.client.ClientSearchResultsPage)1 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)1 CreateQuestionParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters)1