Search in sources :

Example 71 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class DefineNewLoanProductTest method verifyWaiveInterestForLoanAccount.

/*
     * passing locally but not on hudson. 
     */
//http://mifosforge.jira.com/browse/MIFOSTEST-710
@Test(enabled = true)
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyWaiveInterestForLoanAccount() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime systemDateTime = new DateTime(2011, 3, 7, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(systemDateTime);
    //When
    DefineNewLoanProductPage.SubmitFormParameters formParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    formParameters.setInterestWaiver(true);
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineNewLoanProductPage newLoanProductPage = adminPage.navigateToDefineLoanProduct();
    newLoanProductPage.fillLoanParameters(formParameters);
    DefineNewLoanProductPreviewPage previewPage = newLoanProductPage.submitAndGotoNewLoanProductPreviewPage();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    Assert.assertTrue(selenium.isTextPresent("Interest: 31102"));
    Assert.assertTrue(selenium.isTextPresent("Principal: 1506"));
    //When
    LoanProductDetailsPage loanProductDetailsPage = previewPage.submit().navigateToViewLoanDetailsPage();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
    //Then
    Assert.assertTrue(selenium.isChecked("EditLoanProduct.input.includeInterestWaiver"));
    //When
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.editSubmit();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    loanProductDetailsPage = editLoanProductPreviewPage.submit();
    //Then
    Assert.assertTrue(selenium.isTextPresent("Can waive interest on repay loan: Yes"));
    //When
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("WeeklyClient Monday");
    searchParameters.setLoanProduct(formParameters.getOfferingName());
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParameters);
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setDisbursalDateDD(Integer.toString(systemDateTime.getDayOfMonth()));
    disburseParameters.setDisbursalDateMM(Integer.toString(systemDateTime.getMonthOfYear()));
    disburseParameters.setDisbursalDateYYYY(Integer.toString(systemDateTime.getYear()));
    disburseParameters.setPaymentType(PaymentParameters.CASH);
    loanAccountPage.navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseParameters).submitAndNavigateToLoanAccountPage();
    RepayLoanPage repayLoanPage = loanAccountPage.navigateToRepayLoan();
    //Then
    Assert.assertTrue(selenium.isChecked("waiverInterestChckBox"));
    Assert.assertEquals("Note: Interest due will be waived off.", selenium.getText("waiverInterestWarning"));
    Assert.assertFalse(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertTrue(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertEquals(repayLoanPage.waivedRepaymentAmount(), "2,500");
    //When
    repayLoanPage.interestWaiver(false);
    //Then
    Assert.assertTrue(repayLoanPage.isTotalRepaymentAmountVisible());
    Assert.assertFalse(repayLoanPage.isWaivedRepaymentAmoutVisible());
    Assert.assertFalse(selenium.isTextPresent("Note: Interest due will be waived off."));
    Assert.assertEquals(repayLoanPage.totalRepaymentAmount(), "2,509.1");
    //When
    RepayLoanParameters params = new RepayLoanParameters();
    params.setModeOfRepayment("Cash");
    loanAccountPage = repayLoanPage.submitAndNavigateToRepayLoanConfirmationPage(params).submitAndNavigateToLoanAccountDetailsPage();
    //Then
    loanAccountPage.verifyStatus("Closed- Obligation met");
    String[][] accountSummaryTable = { { "", "Original Loan", "Amount paid", "Loan balance" }, { "Principal", "2,500", "2,500", "0" }, { "Interest", "9.1", "9.1", "0" }, { "Fees", "0", "0", "0" }, { "Penalty", "0", "0", "0" }, { "Total", "2,509.1", "2,509.1", "0" } };
    loanAccountPage.verifyAccountSummary(accountSummaryTable);
    loanAccountPage.navigateToAccountActivityPage();
    Assert.assertEquals("Loan Repayment", selenium.getTable("accountActivityTable.2.1").trim());
    Assert.assertEquals("2,500", selenium.getTable("accountActivityTable.2.2").trim());
    Assert.assertEquals("0", selenium.getTable("accountActivityTable.2.10").trim());
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) DateTime(org.joda.time.DateTime) DefineNewLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPreviewPage) EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) RepayLoanPage(org.mifos.test.acceptance.framework.loan.RepayLoanPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) RepayLoanParameters(org.mifos.test.acceptance.framework.loan.RepayLoanParameters) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper) Test(org.testng.annotations.Test)

Example 72 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class LoanProductTestHelper method editLoanProductIncludeQuestionsGroups.

public void editLoanProductIncludeQuestionsGroups(String loanProduct, String... questionGroup) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewLoanProductsPage viewLoanProducts = adminPage.navigateToViewLoanProducts();
    LoanProductDetailsPage loanProductDetailsPage = viewLoanProducts.viewLoanProductDetails(loanProduct);
    EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
    DefineNewLoanProductPage.SubmitFormParameters formParameters = new DefineNewLoanProductPage.SubmitFormParameters();
    formParameters.setQuestionGroups(Arrays.asList(questionGroup));
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitQuestionGroupChanges(formParameters);
    editLoanProductPreviewPage.submit();
}
Also used : EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) ViewLoanProductsPage(org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)

Example 73 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class LoanProductTestHelper method enableInterestWaiver.

public void enableInterestWaiver(String loanProduct, boolean interestWaiver) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewLoanProductsPage viewLoanProducts = adminPage.navigateToViewLoanProducts();
    LoanProductDetailsPage loanProductDetailsPage = viewLoanProducts.viewLoanProductDetails(loanProduct);
    EditLoanProductPage editLoanProductPage = loanProductDetailsPage.editLoanProduct();
    DefineNewLoanProductPage.SubmitFormParameters formParameters = new DefineNewLoanProductPage.SubmitFormParameters();
    formParameters.setInterestWaiver(interestWaiver);
    EditLoanProductPreviewPage editLoanProductPreviewPage = editLoanProductPage.submitInterestWaiverChanges(formParameters);
    editLoanProductPreviewPage.submit();
}
Also used : EditLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage) ViewLoanProductsPage(org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) LoanProductDetailsPage(org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage) EditLoanProductPreviewPage(org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)

Example 74 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class LoanProcessWithDifferentCurrencyTest method createWeeklyLoanProduct.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
private // one of the dependent methods throws Exception
void createWeeklyLoanProduct() throws Exception {
    SubmitMultiCurrencyFormParameters formParameters = getWeeklyLoanProductParameters();
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    adminPage.defineMultiCurrencyLoanProduct(formParameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) SubmitMultiCurrencyFormParameters(org.mifos.test.acceptance.framework.loanproduct.multicurrrency.DefineNewDifferentCurrencyLoanProductPage.SubmitMultiCurrencyFormParameters)

Example 75 with AdminPage

use of org.mifos.test.acceptance.framework.admin.AdminPage in project head by mifos.

the class BackDateLoanProductTest method preparePageForTest.

private DefineNewLoanProductPage preparePageForTest() {
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineNewLoanProductPage newLoanProductPage = adminPage.navigateToDefineLoanProduct();
    SubmitFormParameters parameters = FormParametersHelper.getMonthlyLoanProductParameters();
    return newLoanProductPage.fillLoanParameters(parameters);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)

Aggregations

AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)87 Test (org.testng.annotations.Test)33 HomePage (org.mifos.test.acceptance.framework.HomePage)9 CreateQuestionGroupPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupPage)8 CreateQuestionGroupParameters (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionGroupParameters)7 CreateUserParameters (org.mifos.test.acceptance.framework.user.CreateUserParameters)7 DateTime (org.joda.time.DateTime)6 ImportTransactionsPage (org.mifos.test.acceptance.framework.admin.ImportTransactionsPage)6 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)6 CreateQuestionPage (org.mifos.test.acceptance.framework.questionnaire.CreateQuestionPage)6 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)6 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)5 DefineHiddenMandatoryFieldsPage (org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage)5 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)5 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 EditLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPage)4 EditLoanProductPreviewPage (org.mifos.test.acceptance.framework.loanproduct.EditLoanProductPreviewPage)4 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)4 ViewLoanProductsPage (org.mifos.test.acceptance.framework.loanproduct.ViewLoanProductsPage)4