Search in sources :

Example 1 with CustomizeTextViewPage

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

the class CustomizeTextTest method addEditRemoveCustomizedText.

@Test
public void addEditRemoveCustomizedText() {
    String originalText = "Client";
    String customText = "Person";
    // try some Chinese
    String newCustomText = "有";
    CustomizeTextViewPage customizeTextViewPage = adminTestHelper.addCustomizedText(originalText, customText);
    // verify that it shows up
    customizeTextViewPage.verifyCustomTextIsPresent(originalText, customText);
    verifyClientsAndAccountsTabIsUpdated(customText, customizeTextViewPage);
    // edit the custom text
    CustomizeTextEditPage customizeTextEditPage = customizeTextViewPage.navigateToCustomizeTextEditPage(originalText);
    customizeTextEditPage.setCustomText(newCustomText);
    customizeTextViewPage = customizeTextEditPage.submit();
    // verify that it shows up
    customizeTextViewPage.verifyCustomTextIsPresent(originalText, newCustomText);
    verifyClientsAndAccountsTabIsUpdated(newCustomText, customizeTextViewPage);
    // remove the custom text
    customizeTextViewPage.removeCustomizedText(originalText);
    // verify that custom text is gone
    Assert.assertThat(customizeTextViewPage.getCustomizedTextCount(), is(0));
}
Also used : CustomizeTextViewPage(org.mifos.test.acceptance.framework.admin.CustomizeTextViewPage) CustomizeTextEditPage(org.mifos.test.acceptance.framework.admin.CustomizeTextEditPage) Test(org.testng.annotations.Test)

Example 2 with CustomizeTextViewPage

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

the class CustomizeTextTest method verifyEditRemove.

private void verifyEditRemove() {
    CustomizeTextViewPage customizeTextViewPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().clickEditButton();
    String error = "Please select an item to edit or remove";
    String errorMessage = "No text <" + error + "> present on the page";
    customizeTextViewPage.verifyTextPresent(error, errorMessage);
    customizeTextViewPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().clickRemoveButton();
    customizeTextViewPage.verifyTextPresent(error, errorMessage);
}
Also used : CustomizeTextViewPage(org.mifos.test.acceptance.framework.admin.CustomizeTextViewPage)

Example 3 with CustomizeTextViewPage

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

the class CustomizeTextTest method verifyDefineCustomizedTextPage.

/*
     * http://mifosforge.jira.com/browse/MIFOSTEST-1172
     * Verify 'Define customized text' page
     */
@Test
public void verifyDefineCustomizedTextPage() {
    String originalText = "Client";
    String customText = "Person";
    verifyErrors();
    CustomizeTextViewPage customizeTextViewPage = adminTestHelper.addCustomizedText(originalText, customText);
    customizeTextViewPage.verifyCustomTextIsPresent(originalText, customText);
    verifyEditRemove();
    customizeTextViewPage = navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().navigateToCustomizeTextAddPage().cancel();
    customizeTextViewPage.verifyPage();
    CustomizeTextEditPage customizeTextEditPage = customizeTextViewPage.navigateToCustomizeTextEditPage("Client");
    customizeTextEditPage.verifyOriginalTextInput();
    customizeTextEditPage.setCustomText("");
    customizeTextEditPage.trySubmit();
    String error = "Please specify Custom Text";
    String errorMessage = "No text <" + error + "> present on the page";
    customizeTextEditPage.verifyTextPresent(error, errorMessage);
    customizeTextViewPage = customizeTextEditPage.cancel();
    customizeTextViewPage.verifyPage();
    customizeTextViewPage.done().verifyPage();
    navigationHelper.navigateToAdminPage().navigateToCustomizeTextViewPage().removeCustomizedText(originalText);
}
Also used : CustomizeTextViewPage(org.mifos.test.acceptance.framework.admin.CustomizeTextViewPage) CustomizeTextEditPage(org.mifos.test.acceptance.framework.admin.CustomizeTextEditPage) Test(org.testng.annotations.Test)

Example 4 with CustomizeTextViewPage

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

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