Search in sources :

Example 6 with DateTimeUpdaterRemoteTestingService

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

the class CreateLSIMClientLoanAccountTest method setTime.

private void setTime(int year, int monthOfYear, int dayOfMonth) throws UnsupportedEncodingException {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime systemTime = new DateTime(year, monthOfYear, dayOfMonth, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemTime);
}
Also used : DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 7 with DateTimeUpdaterRemoteTestingService

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

the class ApplyAdjustmentGroupLoanTest method adjustmentWithCommaTest.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void adjustmentWithCommaTest() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    loanAccountEntryPage.setDisbursalDate(new DateTime(2013, 2, 8, 15, 0, 0, 0));
    loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null);
    loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null);
    CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = loanAccountEntryPage.navigateToReviewInstallmentsPage();
    CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
    CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
    LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
    String loanId = loanAccountPage.getAccountId();
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test new GLIM");
    loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
    DisburseLoanParameters params = new DisburseLoanParameters();
    params.setPaymentType(DisburseLoanParameters.CASH);
    loanTestHelper.disburseLoan(loanId, params);
    PaymentParameters paymentParameters = new PaymentParameters();
    paymentParameters.setAmount("2500.0");
    paymentParameters.setPaymentType(PaymentParameters.CASH);
    paymentParameters.setTransactionDateDD("08");
    paymentParameters.setTransactionDateMM("2");
    paymentParameters.setTransactionDateYYYY("2013");
    loanTestHelper.applyGroupPayment(loanId, paymentParameters);
    loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmitGroupLoan("2500.0");
    Assert.assertFalse(selenium.isTextPresent("stack trace"));
    Assert.assertTrue(selenium.isTextPresent("2,500"));
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountPreviewPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage) CreateLoanAccountConfirmationPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) CreateLoanAccountReviewInstallmentPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 8 with DateTimeUpdaterRemoteTestingService

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

the class SavingsPaymentTest method setupTime.

private void setupTime() throws DatabaseUnitException, SQLException, IOException, URISyntaxException {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 3, 13, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
}
Also used : DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 9 with DateTimeUpdaterRemoteTestingService

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

the class UndoLoanDisbursalTest method setTime.

private void setTime(int year, int monthOfYear, int dayOfMonth) throws UnsupportedEncodingException {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(year, monthOfYear, dayOfMonth, 14, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
}
Also used : DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 10 with DateTimeUpdaterRemoteTestingService

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

the class MpesaImportTest method importTransactionsFromFileWithNoErrors.

/**
     * MPESA - Import transactions from file with no errors
     * http://mifosforge.jira.com/browse/MIFOSTEST-688
     * @throws Exception
     */
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException", "PMD.SystemPrintln" })
@Test(enabled = true)
public void importTransactionsFromFileWithNoErrors() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewRolesPage viewRolesPage = adminPage.navigateToViewRolesPage();
    ManageRolePage manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.disablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    adminPage = viewRolesPage.navigateToAdminPage();
    adminPage = adminPage.failNavigationToImportTransactionsPage();
    adminPage.verifyError("You do not have permissions to perform " + "this activity. Contact your system administrator " + "to grant you the required permissions and try again.");
    viewRolesPage = adminPage.navigateToViewRolesPage();
    manageRolePage = viewRolesPage.navigateToManageRolePage("Admin");
    manageRolePage.enablePermission("8_3");
    viewRolesPage = manageRolePage.submitAndGotoViewRolesPage();
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    ImportTransactionsPage importTransactionsPage = importTransaction(path);
    checkIfOutputMatchesExpected(path);
    importTransactionsPage.cancelImportTransaction();
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyExactLoanAmount("2,000");
    SavingsAccountDetailPage savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("0");
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
    importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
    loanAccountPage = navigationHelper.navigateToLoanAccountPage("000100000000013");
    loanAccountPage.verifyStatus(LoanAccountPage.CLOSED);
    ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
    viewRepaymentSchedulePage.verifyFirstInstallmentDate(5, 3, "28-Jan-2011");
    loanAccountPage = viewRepaymentSchedulePage.navigateToLoanAccountPage();
    loanAccountPage.verifyPerformanceHistory("11", "11");
    TransactionHistoryPage transactionHistoryPage = loanAccountPage.navigateToTransactionHistoryPage();
    transactionHistoryPage.verifyTransactionHistory(2013, 2, 48);
    transactionHistoryPage.verifyPostedBy("mifos", 48);
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
}
Also used : ManageRolePage(org.mifos.test.acceptance.framework.admin.ManageRolePage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) ViewRolesPage(org.mifos.test.acceptance.framework.admin.ViewRolesPage) ViewRepaymentSchedulePage(org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage) ImportTransactionsConfirmationPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsConfirmationPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) 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