Search in sources :

Example 51 with AdminPage

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

the class ImportTransactionsTest method importTransactionPageLoad.

//  Test the import transaction page loads with no plugins available  - regression test for MIFOS-2683
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true, groups = "no_db_unit")
public void importTransactionPageLoad() throws Exception {
    navigationHelper = new NavigationHelper(selenium);
    String tempFileName = pluginsUtil.movePluginToTemp();
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    pluginsUtil.movePluginFromTemp(tempFileName);
    (new MifosPage(selenium)).logout();
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) NavigationHelper(org.mifos.test.acceptance.framework.testhelpers.NavigationHelper) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) MifosPage(org.mifos.test.acceptance.framework.MifosPage) Test(org.testng.annotations.Test)

Example 52 with AdminPage

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

the class MonthClosingTest method testMonthClosingPermission.

@Test(enabled = true)
public void testMonthClosingPermission() {
    // When
    AdminPage adminPage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").disablePermission("0_5").verifyPermissionText("0_5", "Can set Month Closing date").submitAndGotoViewRolesPage().navigateToAdminPage();
    // Then
    adminPage.navigateToMonthClosing().submitWithoutPermission();
    // When
    adminPage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin").enablePermission("0_5").verifyPermissionText("0_5", "Can set Month Closing date").submitAndGotoViewRolesPage().navigateToAdminPage();
    // Then
    MonthClosingPage monthClosingPage = adminPage.navigateToMonthClosing();
    monthClosingPage.verifyCurrentMonthClosingDate("-");
    monthClosingPage.fillMonthClosingDate("20/02/12").submit().verifyCurrentMonthClosingDate("20/02/12");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) MonthClosingPage(org.mifos.test.acceptance.framework.admin.MonthClosingPage) Test(org.testng.annotations.Test)

Example 53 with AdminPage

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

the class CustomizeTextTest method verifyCustomizedTextOnVariousPages.

/*
     * http://mifosforge.jira.com/browse/MIFOSTEST-1171
     * Verify customized text on various Mifos pages
     */
@SuppressWarnings("PMD")
@Test
public void verifyCustomizedTextOnVariousPages() {
    TreeMap<String, String> originalCustomText = new TreeMap<String, String>();
    originalCustomText.put("Complete the fields below.", "Fill necessary");
    originalCustomText.put("Click Cancel to return", "Cancel button is to back");
    originalCustomText.put("Product category", "搜索工具");
    originalCustomText.put("Date", "عر");
    originalCustomText.put("fields", "information");
    originalCustomText.put("Targeted Deposits and Withdrawal Restrictions", "deposits and withdrawals");
    originalCustomText.put("details", "有");
    originalCustomText.put("Create new Center", "Define center");
    originalCustomText.put("Create multiple Loan Accounts", "下面的搜索工具");
    originalCustomText.put("Approve multiple loans", "أبجدية‎");
    originalCustomText.put("Client", "Person");
    originalCustomText.put("Home", "Main");
    originalCustomText.put("Clients & Accounts", "òèßñ 有 عربية");
    originalCustomText.put("Then click Preview", "After that click on Preview button");
    originalCustomText.put("Fields marked with an asterisk are required.", "Mandatory information are necessary");
    originalCustomText.put("Date of Birth", "搜索工具");
    originalCustomText.put("Name", "عر");
    originalCustomText.put("User", "Mifos");
    originalCustomText.put("User Title", "Personnel Role");
    originalCustomText.put("Login information", "漢字");
    originalCustomText.put("description", "info");
    originalCustomText.put("recommended Amount for Deposit", "عبية");
    originalCustomText.put("create New group", "Define Group");
    originalCustomText.put("create Loan Account", "عربة");
    originalCustomText.put("reports", "Summaries");
    originalCustomText.put("admin", "عربية");
    originalCustomText.put("first", "1th");
    originalCustomText.put("postal code", "ية عر");
    CustomizeTextViewPage customizeTextViewPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage();
    String value;
    for (String key : originalCustomText.keySet()) {
        CustomizeTextAddPage customizeTextAddPage = customizeTextViewPage.navigateToCustomizeTextAddPage();
        customizeTextAddPage.setOriginalText(key);
        value = originalCustomText.get(key);
        customizeTextAddPage.setCustomText(value);
        customizeTextAddPage.submit();
        verifyCustomTextIsAdded(key, value);
    }
    ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
    verifyClientsAndAccountsCreateCenterLink(originalCustomText.get("Create new Center"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsCreateMultipleLoansLink(originalCustomText.get("Create multiple Loan Accounts"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsApproveMultipleLoansLink(originalCustomText.get("Approve multiple loans"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsCreateClientLink(originalCustomText.get("Client"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsCreateNewClientsText(originalCustomText.get("Client"));
    verifyClientsAndAccountsCreateGroupLink(originalCustomText.get("create New group"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsCreateLoanAccountLink(originalCustomText.get("create Loan Account"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsHomeTab(originalCustomText.get("Home"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsTab(originalCustomText.get("Clients & Accounts"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsAdminTab(originalCustomText.get("admin"), clientsAndAccountsHomepage);
    verifyClientsAndAccountsReportsTab(originalCustomText.get("reports"), clientsAndAccountsHomepage);
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    adminPage.navigateToDefineSavingsProduct();
    verifyDefineNewSavingsProductText(originalCustomText.get("Complete the fields below."));
    verifyDefineNewSavingsProductText(originalCustomText.get("Click Cancel to return"));
    verifyDefineNewSavingsProductText(originalCustomText.get("Product category"));
    verifyDefineNewSavingsProductTextDate(originalCustomText.get("Date"));
    verifyDefineNewSavingsProductTextFields(originalCustomText.get("fields"));
    verifyDefineNewSavingsProductText(originalCustomText.get("Targeted Deposits and Withdrawal Restrictions"));
    verifyDefineNewSavingsProductTextDetails(originalCustomText.get("details"));
    verifyDefineNewSavingsProductTextDescription(originalCustomText.get("description"));
    verifyDefineNewSavingsProductTextDeposit(originalCustomText.get("recommended Amount for Deposit"));
    AdminPage adminPageAgain = navigationHelper.navigateToAdminPage();
    ChooseOfficePage chooseOfficePage = adminPageAgain.navigateToCreateUserPage();
    chooseOfficePage.selectOffice("branch1");
    verifyDefineNewSystemUserText(originalCustomText.get("Then click Preview"));
    verifyDefineNewSystemUserText(originalCustomText.get("Fields marked with an asterisk are required."));
    verifyDefineNewSystemUserText(originalCustomText.get("Date of Birth"));
    verifyDefineNewSystemUserTextName(originalCustomText.get("Name"));
    verifyDefineNewSystemUserText(originalCustomText.get("User"));
    verifyDefineNewSystemUserText(originalCustomText.get("User Title"));
    verifyDefineNewSystemUserText(originalCustomText.get("Login information"));
    verifyDefineNewSystemUserTextFirst(originalCustomText.get("first"));
    verifyDefineNewSystemUserTextPostal(originalCustomText.get("postal code"));
    AdminPage goToAdminPage = navigationHelper.navigateToAdminPage();
    goToAdminPage.navigateToCustomizeTextViewPage();
    for (Entry<String, String> entry : originalCustomText.entrySet()) {
        customizeTextViewPage.removeCustomizedText(entry.getKey());
    }
    Assert.assertThat(customizeTextViewPage.getCustomizedTextCount(), is(0));
    ClientsAndAccountsHomepage clientsAndAccountsPage = navigationHelper.navigateToClientsAndAccountsPage();
    verifyClientsAndAccountsCreateCenterLink("Create new Center", clientsAndAccountsPage);
    verifyClientsAndAccountsCreateMultipleLoansLink("Create multiple Loan Accounts", clientsAndAccountsPage);
    verifyClientsAndAccountsApproveMultipleLoansLink("Approve multiple loans", clientsAndAccountsPage);
    verifyClientsAndAccountsCreateClientLink("Client", clientsAndAccountsPage);
    verifyClientsAndAccountsCreateNewClientsText("Client");
    verifyClientsAndAccountsCreateGroupLink(originalCustomText.get("create New group"), clientsAndAccountsPage);
    verifyClientsAndAccountsCreateLoanAccountLink(originalCustomText.get("create Loan Account"), clientsAndAccountsPage);
    verifyClientsAndAccountsHomeTab("Home", clientsAndAccountsPage);
    verifyClientsAndAccountsTab("Clients & Accounts", clientsAndAccountsPage);
    verifyClientsAndAccountsAdminTab(originalCustomText.get("admin"), clientsAndAccountsPage);
    verifyClientsAndAccountsReportsTab(originalCustomText.get("reports"), clientsAndAccountsPage);
    AdminPage adminHomePage = navigationHelper.navigateToAdminPage();
    adminHomePage.navigateToDefineSavingsProduct();
    verifyDefineNewSavingsProductText("Complete the fields below.");
    verifyDefineNewSavingsProductText("Click Cancel to return");
    verifyDefineNewSavingsProductText("Product category");
    verifyDefineNewSavingsProductTextDate("Date");
    verifyDefineNewSavingsProductTextFieldsRemoved("fields");
    verifyDefineNewSavingsProductText("Targeted Deposits and Withdrawal Restrictions");
    verifyDefineNewSavingsProductTextDetails("details");
    verifyDefineNewSavingsProductTextDescription(originalCustomText.get("description"));
    verifyDefineNewSavingsProductTextDeposit(originalCustomText.get("recommended Amount for Deposit"));
    AdminPage adminHomePageAgain = navigationHelper.navigateToAdminPage();
    adminHomePageAgain.navigateToCreateUserPage();
    chooseOfficePage.selectOffice("branch1");
    verifyDefineNewSystemUserText("Then click Preview");
    verifyDefineNewSystemUserText("Fields marked with an asterisk are required.");
    verifyDefineNewSystemUserText("Date of Birth");
    verifyDefineNewSystemUserTextNameRemoved("Name");
    verifyDefineNewSystemUserText("User");
    verifyDefineNewSystemUserText("User Title");
    verifyDefineNewSystemUserText("Login information");
    verifyDefineNewSystemUserTextFirst(originalCustomText.get("first"));
    verifyDefineNewSystemUserTextPostal(originalCustomText.get("postal code"));
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CustomizeTextAddPage(org.mifos.test.acceptance.framework.admin.CustomizeTextAddPage) CustomizeTextViewPage(org.mifos.test.acceptance.framework.admin.CustomizeTextViewPage) ClientsAndAccountsHomepage(org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage) ChooseOfficePage(org.mifos.test.acceptance.framework.office.ChooseOfficePage) TreeMap(java.util.TreeMap) Test(org.testng.annotations.Test)

Example 54 with AdminPage

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

the class MpesaImportTest method importTheSameFiles.

/**
     * MPESA - Import has errors and user chooses to import
     * a different file with some valid and invalid data.
     * http://mifosforge.jira.com/browse/MIFOSTEST-695
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void importTheSameFiles() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 01, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String path = this.getClass().getResource("/mpesa/" + FILE_WITH_NO_ERRORS).toString();
    String dataset = "mpesa_export_dbunit.xml";
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, dataset, dataSource, selenium);
    propertiesHelper.setImportTransactionOrder("AL3,AL5");
    //When
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    ImportTransactionsConfirmationPage importTransactionsConfirmationPage = importTransactionsPage.importTransactions(path, EXCEL_IMPORT_TYPE);
    //Then
    importTransactionsConfirmationPage.verifyImportSuccess("You have successfully imported transactions.");
    LoanAccountPage 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 savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage("000100000000015");
    savingsAccountDetailPage.verifySavingsAmount("3170.0");
    savingsAccountDetailPage.verifyDate("28/01/2011");
    //When
    adminPage = navigationHelper.navigateToAdminPage();
    importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage = importTransactionsPage.failImportTransaction(path, EXCEL_IMPORT_TYPE);
    //Then
    importTransactionsPage.checkErrors(new String[] { "Same file has been already imported. Please import a different file." });
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) TransactionHistoryPage(org.mifos.test.acceptance.framework.loan.TransactionHistoryPage) 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)

Example 55 with AdminPage

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

the class MpesaImportTest method importTransactionPageLoad.

//  Test the import transaction page loads with no plugins available  - regression test for MIFOS-2683
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void importTransactionPageLoad() throws Exception {
    String tempFileName = pluginsUtil.movePluginToTemp();
    AdminPage adminPage = navigationHelper.navigateToAdminPage();
    ImportTransactionsPage importTransactionsPage = adminPage.navigateToImportTransactionsPage();
    importTransactionsPage.verifyPage();
    pluginsUtil.movePluginFromTemp(tempFileName);
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) ImportTransactionsPage(org.mifos.test.acceptance.framework.admin.ImportTransactionsPage) Test(org.testng.annotations.Test)

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