Search in sources :

Example 1 with CustomizeTextAddPage

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

the class AdminTestHelper method addCustomizedText.

public CustomizeTextViewPage addCustomizedText(String originalText, String customText) {
    CustomizeTextAddPage customizeTextAddPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().navigateToCustomizeTextAddPage();
    customizeTextAddPage.setOriginalText(originalText);
    customizeTextAddPage.setCustomText(customText);
    return customizeTextAddPage.submit();
}
Also used : CustomizeTextAddPage(org.mifos.test.acceptance.framework.admin.CustomizeTextAddPage)

Example 2 with CustomizeTextAddPage

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

the class CustomizeTextTest method verifyErrors.

private void verifyErrors() {
    verifyEditRemove();
    CustomizeTextAddPage customizeTextAddPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().navigateToCustomizeTextAddPage();
    String text = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm";
    String error = "The maximum length for Original Text is 50 characters";
    String errorMessage = "No text <" + error + "> present on the page";
    customizeTextAddPage.setOriginalText(text);
    customizeTextAddPage.setCustomText(text);
    customizeTextAddPage = customizeTextAddPage.trySubmit();
    customizeTextAddPage.verifyTextPresent(error, errorMessage);
    error = "The maximum length for Custom Text is 50 characters";
    customizeTextAddPage.verifyTextPresent(error, errorMessage);
    text = "";
    error = "Please specify Custom Text";
    customizeTextAddPage.setOriginalText(text);
    customizeTextAddPage.setCustomText(text);
    customizeTextAddPage = customizeTextAddPage.trySubmit();
    customizeTextAddPage.verifyTextPresent(error, errorMessage);
    error = "Please specify Original Text";
    customizeTextAddPage.verifyTextPresent(error, errorMessage);
}
Also used : CustomizeTextAddPage(org.mifos.test.acceptance.framework.admin.CustomizeTextAddPage)

Example 3 with CustomizeTextAddPage

use of org.mifos.test.acceptance.framework.admin.CustomizeTextAddPage 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)

Aggregations

CustomizeTextAddPage (org.mifos.test.acceptance.framework.admin.CustomizeTextAddPage)3 TreeMap (java.util.TreeMap)1 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 CustomizeTextViewPage (org.mifos.test.acceptance.framework.admin.CustomizeTextViewPage)1 ChooseOfficePage (org.mifos.test.acceptance.framework.office.ChooseOfficePage)1 Test (org.testng.annotations.Test)1