Search in sources :

Example 31 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class SystemInfoDateTimeTest method tearDown.

@AfterMethod
public void tearDown() {
    (new MifosPage(selenium)).logout();
    new DateTimeUpdaterRemoteTestingService(selenium).resetDateTime();
}
Also used : MifosPage(org.mifos.test.acceptance.framework.MifosPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) AfterMethod(org.testng.annotations.AfterMethod)

Example 32 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class SystemInfoDateTimeTest method setUp.

@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    adminTestHelper = new AdminTestHelper(selenium);
    new DateTimeUpdaterRemoteTestingService(selenium).resetDateTime();
}
Also used : AdminTestHelper(org.mifos.test.acceptance.framework.testhelpers.AdminTestHelper) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 33 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class SystemInfoDateTimeTest method verifyDateTimeWithTimeMachineModification.

/**
     * Verify current date and time display and that current
     * date and time can be modified using "time machine"
     * http://mifosforge.jira.com/browse/MIFOSTEST-639
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyDateTimeWithTimeMachineModification() throws Exception {
    DateTime targetTime = new DateTime(2008, 1, 1, 0, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    TimeMachinePage timeMachinePage = dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    timeMachinePage.verifySuccess(targetTime);
    SystemInfoPage systemInfoPage = adminTestHelper.navigateToSystemInfoPage();
    systemInfoPage.verifyDateTime(targetTime);
}
Also used : TimeMachinePage(org.mifos.test.acceptance.framework.TimeMachinePage) SystemInfoPage(org.mifos.test.acceptance.framework.admin.SystemInfoPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 34 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class QuestionGroupSavingsAccountTest method verifyCapturingResponsesDuringSavingsCreation.

//http://mifosforge.jira.com/browse/MIFOSTEST-669
/*
     * need to fix up commonality between questionaire pages for loan and savings.
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void verifyCapturingResponsesDuringSavingsCreation() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 28, 15, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    setQuestionGroup();
    createClient("669");
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString("Joe669 Doe669");
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("248.0");
    QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textquestion");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[1].value", "100");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[0].questions[2].value", "Text");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[0].questions[3].value", "blue");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[1].sectionDetails[1].questions[0].values", "two");
    questionResponseParameters.addTextAnswer("questionGroups[1].sectionDetails[1].questions[1].value", "6");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[0].value", "04/02/2011");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[1].values", "one");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[2].value", "123");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "7");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[1].questions[0].value", "Text");
    questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[1].questions[1].value", "red");
    questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[2].questions[0].value", "Text");
    QuestionResponseParameters questionResponseParameters2 = new QuestionResponseParameters();
    questionResponseParameters2.addTextAnswer("questionGroups[1].sectionDetails[0].questions[0].value", "textQuestion");
    questionResponseParameters2.addTextAnswer("questionGroups[0].sectionDetails[0].questions[3].value", "9");
    savingsAccountHelper.fillQuestionGroupsDurringCreationSavingsAccount(searchParameters, submitAccountParameters, questionResponseParameters);
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.editAdditionalInformationDurringCreationSavingsAccount(questionResponseParameters2);
    String savingsId = savingsAccountDetailPage.getAccountId();
    questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount");
    questionGroupTestHelper.markQuestionAsInactive("SingleSelect");
    questionGroupTestHelper.markQuestionAsInactive("NumberBetween5And10");
    questionGroupTestHelper.markQuestionAsInactive("Question1");
    questionGroupTestHelper.markQuestionAsInactive("question 1");
    CreateQuestionParameters createQuestionParameters = new CreateQuestionParameters();
    createQuestionParameters.setType(CreateQuestionParameters.TYPE_FREE_TEXT);
    createQuestionParameters.setText("newQuestion232");
    List<CreateQuestionParameters> newQuestionList = new ArrayList<CreateQuestionParameters>();
    newQuestionList.add(createQuestionParameters);
    questionGroupTestHelper.addNewQuestionsToQuestionGroup("QGForCreateSavingsAccount2", newQuestionList);
    Map<String, String> questionsAndAnswers = new HashMap<String, String>();
    questionsAndAnswers.put("MultiSelect", "two");
    questionsAndAnswers.put("Number", "100");
    questionsAndAnswers.put("FreeText", "textquestion");
    String[] questionsExist = { "newQuestion232", "MultiSelect", "Number", "FreeText" };
    String[] questionsInactive = { "SingleSelect", "NumberBetween5And10", "Question1", "question 1", "Date" };
    QuestionnairePage questionnairePage = savingsAccountHelper.navigateToQuestionResponseDuringCreateSavings(searchParameters, submitAccountParameters);
    questionnairePage.verifyQuestionsExists(questionsExist);
    questionnairePage.verifyQuestionsDoesnotappear(questionsInactive);
    verifyQuestionResponsesExistInDatabase(savingsId, "Create Savings", questionsAndAnswers);
    questionGroupTestHelper.markQuestionGroupAsInactive("QGForCreateSavingsAccount2");
    questionGroupTestHelper.markQuestionAsActive("SingleSelect");
    questionGroupTestHelper.markQuestionAsActive("NumberBetween5And10");
    questionGroupTestHelper.markQuestionAsActive("Question1");
    questionGroupTestHelper.markQuestionAsActive("question 1");
}
Also used : HashMap(java.util.HashMap) QuestionnairePage(org.mifos.test.acceptance.framework.questionnaire.QuestionnairePage) ArrayList(java.util.ArrayList) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) CreateQuestionParameters(org.mifos.test.acceptance.framework.questionnaire.CreateQuestionParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) Test(org.testng.annotations.Test)

Example 35 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class QuestionGroupSavingsAccountTest method verifyCapturingResponsesDuringSavingsClosing.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyCapturingResponsesDuringSavingsClosing() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 28, 15, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    questionGroupTestHelper.markQuestionGroupAsActive("QGForCloseSavings");
    try {
        createClient("670");
        CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
        searchParameters.setSearchString("Joe670 Doe670");
        searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
        CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
        submitAccountParameters.setAmount("248.0");
        QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
        questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].valuesAsArray", "three");
        questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "20");
        String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
        EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
        editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
        editAccountStatusParameters.setNote("test");
        savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
        String[] questionsExist = { "MultiSelect", "Number" };
        savingsAccountHelper.fillQuestionGroupsDuringClosingSavingsAccount(savingsId, questionResponseParameters, questionsExist);
        Map<String, String> questionsAndAnswers = new HashMap<String, String>();
        questionsAndAnswers.put("MultiSelect", "three");
        questionsAndAnswers.put("Number", "20");
        verifyQuestionResponsesExistInDatabase(savingsId, "Close Savings", questionsAndAnswers);
    } finally {
        questionGroupTestHelper.markQuestionGroupAsInactive("QGForCloseSavings");
    }
}
Also used : HashMap(java.util.HashMap) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Aggregations

DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)103 DateTime (org.joda.time.DateTime)81 BeforeMethod (org.testng.annotations.BeforeMethod)41 Test (org.testng.annotations.Test)22 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)21 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)20 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)19 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)16 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)10 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)9 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)9 MifosPage (org.mifos.test.acceptance.framework.MifosPage)8 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)8 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)8 AfterMethod (org.testng.annotations.AfterMethod)8 CustomPropertiesHelper (org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper)7 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)6 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)6 SavingsAccountHelper (org.mifos.test.acceptance.framework.testhelpers.SavingsAccountHelper)6 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)5