Search in sources :

Example 26 with ClientViewDetailsPage

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

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

the class ClientTest method verifyClientCreatedWithActiveStatus.

/**
     * Verify when Pending Approval (Clients) is set to false; the system transitions the account to 'Active state' when
     * creating new clients http://mifosforge.jira.com/browse/MIFOSTEST-209
     *
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyClientCreatedWithActiveStatus() throws Exception {
    applicationDatabaseOperation.updateCustomerState("2", "0");
    propertiesHelper.setClientPendingApprovalStateEnabled("false");
    String officeName = "MyOfficeDHMFT";
    String loanOfficer = "loan officer";
    ClientViewDetailsPage clientViewDetailsPage = clientTestHelper.createClientAndVerify(loanOfficer, officeName);
    clientViewDetailsPage.verifyStatus("Active");
    // restore original settings
    applicationDatabaseOperation.updateCustomerState("2", "1");
    propertiesHelper.setClientPendingApprovalStateEnabled("true");
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) Test(org.testng.annotations.Test)

Example 28 with ClientViewDetailsPage

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

the class ClientTest method createClientAndChangeStatusTest.

@Test(singleThreaded = true, groups = { "smoke", "client", "acceptance", "ui", "no_db_unit" }, enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-208
void createClientAndChangeStatusTest() throws Exception {
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    // When / Then
    clientTestHelper.changeCustomerStatus(clientDetailsPage);
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) Test(org.testng.annotations.Test)

Example 29 with ClientViewDetailsPage

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

the class ClientTest method addClientWithSavingToGroupWithSavingsCheckGroupCalculation.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//blocked by http://mifosforge.jira.com/browse/MIFOS-4272 - ldomzalski
@Test(enabled = false)
public void addClientWithSavingToGroupWithSavingsCheckGroupCalculation() throws Exception {
    String groupName = "group1";
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("240.0");
    EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
    editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
    editAccountStatusParameters.setNote("change status to active");
    // When
    ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
    clientTestHelper.changeCustomerStatus(clientDetailsPage, ClientStatus.ACTIVE);
    String clientName = clientDetailsPage.getHeading();
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    searchParameters.setSearchString(clientName);
    String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
    savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
    SavingsProductParameters savingsProductParameters = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2009, 7, 13, 12, 0, 0, 0), SavingsProductParameters.MANDATORY, SavingsProductParameters.GROUPS);
    savingsProductParameters.setShortName("M-45");
    savingsProductParameters.setAmountAppliesTo(SavingsProductParameters.PER_INDIVIDUAL);
    savingsProductHelper.createSavingsProduct(savingsProductParameters);
    searchParameters.setSavingsProduct(savingsProductParameters.getProductInstanceName());
    searchParameters.setSearchString(groupName);
    savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
    savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
    clientTestHelper.addClientToGroup(clientName, groupName);
    // Then
    Integer numberOfGroupMembers = Integer.parseInt(navigationHelper.navigateToGroupViewDetailsPage(groupName).getNumberOfClientsInGroup());
    savingsAccountHelper.verifyTotalAmountDue(savingsId, numberOfGroupMembers, Float.parseFloat(submitAccountParameters.getAmount()));
}
Also used : CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTime(org.joda.time.DateTime) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 30 with ClientViewDetailsPage

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

the class LoanTestHelper method verifyPerformenceHistory.

public void verifyPerformenceHistory(String clientName, PerformanceHistoryAtributes performanceHistoryAtributes) {
    ClientViewDetailsPage clientViewDetailsPage = navigationHelper.navigateToClientViewDetailsPage(clientName);
    clientViewDetailsPage.verifyPerformanceHistory(performanceHistoryAtributes);
}
Also used : ClientViewDetailsPage(org.mifos.test.acceptance.framework.client.ClientViewDetailsPage)

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