use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class AccountingIntegrationTest method setUp.
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
appLauncher = new AppLauncher(selenium);
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "REST_API_20110912_dbunit.xml", dataSource, selenium);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2012, 12, 4, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class LoanImportTest method verifyImportLoanAccountsToClient.
/**
* MIFOS-5662: Add the possibility to import new Loans data.
* Test loads basic xls spreadsheet and test for rows parsed with errors. Then submits successfully parsed rows.
* Accounts are imported to client.
*/
private void verifyImportLoanAccountsToClient(int loanRecurrenceTypeId, boolean enableLSIM, int[] skipErrorLineIndices) throws Exception {
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_dbunit.xml", dataSource, selenium);
//changing date so dates in xls spreadsheet will be appropriate
targetTime = new DateTime(2012, 6, 22, 12, 0, 0, 0);
DateTimeUpdaterRemoteTestingService dtUpdate = new DateTimeUpdaterRemoteTestingService(selenium);
dtUpdate.setDateTime(targetTime);
applicationDatabaseOperation.updateLSIM((enableLSIM) ? 1 : 0);
ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
try {
manageRolePage.enablePermission("8_7");
} catch (AssertionError ex) {
Logger.getAnonymousLogger().info("Permission is marked.");
}
manageRolePage.submitAndGotoViewRolesPage();
if (!valuesDefined) {
valuesDefined = defineValuesForProducts();
}
String succesNumber = "1";
String errorNumber = Integer.toString(27 - skipErrorLineIndices.length);
String testID = "TID1";
arrayOfErrors = buildArrayOfErrorsForImportLoanTest(testID, skipErrorLineIndices);
SubmitFormParameters parameters = loanProductTestHelper.defineLoanProductParameters(10, 100, 1, 1, loanRecurrenceTypeId);
parameters.setOfferingName(productForClient);
parameters.setMinLoanAmount("5");
parameters.setMaxLoanAmount("1000");
parameters.setMinInterestRate("1");
parameters.setMaxInterestRate("50");
parameters.setMinInstallemnts("2");
parameters.setMaxInstallments("50");
parameters.setGracePeriodType(SubmitFormParameters.GRACE_ON_ALL_REPAYMENTS);
parameters.setGracePeriodDuration("10");
try {
loanProductTestHelper.defineNewLoanProduct(parameters);
} catch (AssertionError ae) {
Logger.getAnonymousLogger().info("Product exists");
}
String importFile = this.getClass().getResource("/ImportLoanAccountsTest.xls").toString();
ImportLoansReviewPage reviewPage = adminTestHelper.loadImportLoansFileAndSubmitForReview(importFile);
reviewPage.validateErrors(arrayOfErrors);
reviewPage.validateSuccesText(succesNumber);
ImportLoansSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
summaryPage.verifySuccesString(succesNumber);
summaryPage.verifyErrorStroing(errorNumber);
valuesDefined = false;
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class CreateGroupLoanAccountTest method newMonthlyGroupLoanAccountWithMeetingOnSpecificDayOfMonth.
@Test(enabled = true)
@SuppressWarnings({ "PMD.SignatureDeclareThrowsException" })
public void newMonthlyGroupLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2010, 8, 13, 1, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
homePage = loginSuccessfully();
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("MonthlyGroup");
searchParameters.setLoanProduct("MonthlyGroupFlatLoan1stOfMonth");
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
submitAccountParameters.setAmount("1000.0");
ClientsAndAccountsHomepage clientsAndAccountsPage = homePage.navigateToClientsAndAccountsUsingHeaderTab();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsPage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(searchParameters);
createLoanAccountEntryPage.verifyPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountEntryPage.submitAndNavigateToLoanAccountConfirmationPage(submitAccountParameters);
createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class CreateGroupLoanAccountTest method newWeeklyGroupLoanAccount.
//http://mifosforge.jira.com/browse/MIFOSTEST-303
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void newWeeklyGroupLoanAccount() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 25, 1, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setSearchString("groupWithoutLoan");
formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.setAmount("3000.0");
createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 2, 25, 15, 0, 0, 0));
selectAdditionalFees();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyFirstInstallmentDateAndDisbursalDateOnReviewPage();
verifyAdditionalFeesOnReviewPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
verifyFirstInstallmentDateAndDisbursalDateOnPreviewPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("4");
loanAccountPage.verifyDisbursalDate("25/02/2011");
loanAccountPage.verifyPrincipalOriginal("3,000");
loanAccountPage.verifyLoanTotalBalance("3,466");
loanAccountPage.verifyFeesOriginal("410");
loanAccountPage.verifyInterestOriginal("56");
verifyFees();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "04-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "11-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "18-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "25-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "750.2");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "749.4");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100");
viewRepaymentSchedulePage.navigateToLoanAccountPage();
EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
editLoanAccountStatusParameters.setNote("test");
loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
disburseParameters.setDisbursalDateDD("25");
disburseParameters.setDisbursalDateMM("02");
disburseParameters.setDisbursalDateYYYY("2011");
loanTestHelper.disburseLoan(loanId, disburseParameters);
}
use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.
the class LoanAccountCycleTest method setUp.
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 25, 15, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
loanTestHelper = new LoanTestHelper(selenium);
loanProductTestHelper = new LoanProductTestHelper(selenium);
}
Aggregations