Search in sources :

Example 76 with AdminPage

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

the class LoanProcessWithDifferentCurrencyTest method createLoanProductThenAccount.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test
public // http://mifosforge.jira.com/browse/MIFOSTEST-657
void createLoanProductThenAccount() throws Exception {
    //Given
    propertiesHelper.setAdditionalCurrenciesCode("EUR,USD");
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 17, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "LoanProcessWithDifferentCurrencyTest_001_dbunit.xml", dataSource, selenium);
    //When
    propertiesHelper.setDigitsAfterDecimal(2);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ViewOrganizationSettingsPage viewOrganizationSettingsPage = adminPage.navigateToViewOrganizationSettingsPage();
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Currency: USD" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Currency: EUR" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Number of digits after decimal: 2" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Final Round Off Multiple: 1" });
    viewOrganizationSettingsPage.verifyCurrencies(new String[] { "Initial Round Off Multiple: 1" });
    //Then
    FeesCreatePage.SubmitFormParameters formParameters = FormParametersHelper.getOneTimeLoanMultiCurrencyFeesParameters();
    adminPage = navigationHelper.navigateToAdminPage();
    formParameters.setFeeName("USDfee");
    adminPage.defineNewFees(formParameters);
    formParameters = FormParametersHelper.getOneTimeLoanMultiCurrencyFeesParameters();
    adminPage = navigationHelper.navigateToAdminPage();
    formParameters.setFeeName("USDfeeAdditional");
    formParameters.setAmount(20.0);
    adminPage.defineNewFees(formParameters);
    createWeeklyLoanProduct();
    String loanAccountId = createLoanAccountOfDifferentCurrency("Client-1-USD");
    pendingApprovalToApplicationApproved(loanAccountId);
    disburseLoan(loanAccountId);
    applyPayment(loanAccountId);
    navigationHelper.navigateToLoanAccountPage(loanAccountId);
    //veryfy "USDfee"(10) and "USDfeeAdditional"(20)
    Assert.assertEquals(selenium.getTable("loanSummaryTable.3.1"), "30");
    //restore parameters
    propertiesHelper.setDigitsAfterDecimal(1);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ViewOrganizationSettingsPage(org.mifos.test.acceptance.framework.admin.ViewOrganizationSettingsPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) FeesCreatePage(org.mifos.test.acceptance.framework.admin.FeesCreatePage) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 77 with AdminPage

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

the class ClientTest method verifyErrorsMessages.

@Test(singleThreaded = true, groups = { "smoke", "client", "acceptance", "ui", "no_db_unit" }, enabled = true)
public void verifyErrorsMessages() {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineHiddenMandatoryFieldsPage mandatoryFieldsPage = adminPage.navigateToDefineHiddenMandatoryFields();
    mandatoryFieldsPage.checkMandatoryCitizenShip();
    mandatoryFieldsPage.checkMandatoryEthnicity();
    mandatoryFieldsPage.checkMandatoryMaritalStatus();
    mandatoryFieldsPage.submit();
    CreateClientEnterPersonalDataPage personalDataPage = navigationHelper.navigateToCreateClientEnterPersonalDataPage(officeName);
    String[] errors = personalDataPage.getMandatoryBlankFieldsNames();
    String[] fields = new String[] { "Salutation", "First Name", "Last Name", "Date of birth", "Gender", "Ethnicity", "Citizenship", "Poverty status", "Marital Status" };
    for (int i = 0; i < fields.length; ++i) {
        Assert.assertEquals(fields[i], errors[i]);
    }
    adminPage = navigationHelper.navigateToAdminPage();
    adminPage.navigateToDefineHiddenMandatoryFields();
    mandatoryFieldsPage.uncheckMandatoryCitizenShip();
    mandatoryFieldsPage.uncheckMandatoryEthnicity();
    mandatoryFieldsPage.uncheckMandatoryMaritalStatus();
    mandatoryFieldsPage.submit();
    adminPage.logout();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateClientEnterPersonalDataPage(org.mifos.test.acceptance.framework.client.CreateClientEnterPersonalDataPage) DefineHiddenMandatoryFieldsPage(org.mifos.test.acceptance.framework.admin.DefineHiddenMandatoryFieldsPage) Test(org.testng.annotations.Test)

Example 78 with AdminPage

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

the class AdminTestHelper method loadClientDataImportFileAndSubmitForReview.

public ClientDataImportReviewPage loadClientDataImportFileAndSubmitForReview(String importFile) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ClientDataImportPage selectFilePage = adminPage.navigateToClientDataImportPage();
    selectFilePage.verifyPage();
    ClientDataImportReviewPage reviewPage = selectFilePage.submitToReview(importFile);
    reviewPage.verifyPage();
    return reviewPage;
}
Also used : ClientDataImportReviewPage(org.mifos.test.acceptance.framework.admin.ClientDataImportReviewPage) AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ClientDataImportPage(org.mifos.test.acceptance.framework.admin.ClientDataImportPage)

Example 79 with AdminPage

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

the class AdminTestHelper method loadImportSavingsFileAndSubmitForReview.

public ImportSavingsReviewPage loadImportSavingsFileAndSubmitForReview(String importFile) {
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportSavingsPage selectFilePage = adminPage.navigateToImportSavingPage();
    selectFilePage.verifyPage();
    ImportSavingsReviewPage reviewPage = selectFilePage.submitToReview(importFile);
    reviewPage.verifyPage();
    return reviewPage;
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportSavingsPage(org.mifos.test.acceptance.framework.admin.ImportSavingsPage) ImportSavingsReviewPage(org.mifos.test.acceptance.framework.admin.ImportSavingsReviewPage)

Example 80 with AdminPage

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

the class ClientLoanDisbursalTest method verifyAcceptedPaymentTypesForDisbursementsOfLoan.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-249
void verifyAcceptedPaymentTypesForDisbursementsOfLoan() throws Exception, InterruptedException {
    // When
    NavigationHelper navigationHelper = new NavigationHelper(selenium);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    DefineAcceptedPaymentTypesPage defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.CHEQUE);
    adminPage = navigationHelper.navigateToAdminPage();
    defineAcceptedPaymentTypesPage = adminPage.navigateToDefineAcceptedPaymentType();
    defineAcceptedPaymentTypesPage.addLoanDisbursementsPaymentType(defineAcceptedPaymentTypesPage.VOUCHER);
    LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    searchParams.setSearchString("Stu1233266063395 Client1233266063395");
    //Extension https://mifosforge.jira.com/browse/MIFOSTEST-1194
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
    DisburseLoanPage disburseLoanPage = loanAccountPage.navigateToDisburseLoan();
    DisburseLoanParameters params = new DisburseLoanParameters();
    params.setDisbursalDateDD("20");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    params.setPaymentType(params.CASH);
    disburseLoanPage.verifyDisbursalDateIsFutureDate(params);
    //disburseLoanPage.submitWithWrongParams(params, "Date of transaction can not be a future date");
    params.setDisbursalDateDD("01");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    disburseLoanPage.verifyDisbursalDateIsPriorToClientMeetingSchedule(params);
    params.setDisbursalDateDD("04");
    params.setDisbursalDateMM("03");
    params.setDisbursalDateYYYY("2011");
    //Then
    disburseLoanPage.verifyModeOfPayments();
    disburseLoanPage.submitAndNavigateToDisburseLoanConfirmationPage(params).submitAndNavigateToLoanAccountPage();
    String[] locators = { "Payment rcvd.", "accountActivityTable.2.1" };
    loanAccountPage.navigateToViewLoanAccountActivityPage().verifyAllElementsArePresent(locators);
    //When
    disburseLoanPage = navigationHelper.navigateToLoanAccountPage("000100000000020").navigateToDisburseLoan();
    //Then
    disburseLoanPage.verifyModeOfPayments();
    disburseLoanPage.verifyPaymentModesOfPaymentAreEmpty();
    disburseLoanPage.verifyPaymentModeOfPaymentIsEditable("payment mode of payment must be editable when a disbursal fee exists.");
}
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) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) DisburseLoanPage(org.mifos.test.acceptance.framework.loan.DisburseLoanPage) DefineAcceptedPaymentTypesPage(org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) LoanTestHelper(org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)

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