Search in sources :

Example 16 with PageModeMenuCommand

use of com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminEmailTest.

/**
 * Site admin email test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminEmailTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    loginAsAdmin(userPageVisit);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("email"));
    userPageVisit.sendEmailOnEmailPage("james@hack23.com", "siteAdminEmailTest", "siteAdminEmailTest content");
    userPageVisit.checkNotificationMessage("Email Sent");
}
Also used : WebDriver(org.openqa.selenium.WebDriver) PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) Test(org.junit.Test)

Example 17 with PageModeMenuCommand

use of com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminApplicationEventTest.

/**
 * Site admin application event test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminApplicationEventTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    loginAsAdmin(userPageVisit);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Application Action Event"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, ""));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) Test(org.junit.Test)

Example 18 with PageModeMenuCommand

use of com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand in project cia by Hack23.

the class AdminRoleSystemTest method visitAdminDataSummaryViewUpdateSearchIndexTest.

/**
 * Visit admin data summary view update search index test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void visitAdminDataSummaryViewUpdateSearchIndexTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    loginAsAdmin(userPageVisit);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, ""));
    final WebElement updateSearchIndexButton = userPageVisit.findButton("Update Search Index");
    assertNotNull("Expect to find a Update Search Index Button", updateSearchIndexButton);
    userPageVisit.performClickAction(updateSearchIndexButton);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) WebElement(org.openqa.selenium.WebElement) Test(org.junit.Test)

Example 19 with PageModeMenuCommand

use of com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminEmailFailedNoValidEmailTest.

/**
 * Site admin email failed no valid email test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminEmailFailedNoValidEmailTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    loginAsAdmin(userPageVisit);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("email"));
    userPageVisit.sendEmailOnEmailPage("nonvalidemail", "siteAdminEmailFailedNoValidEmailTest", "siteAdminEmailFailedNoValidEmailTest content");
// TODO check button enabled and field messsage
// userPageVisit.checkNotificationMessage("Send email failedEmail is not a valid email address");
}
Also used : WebDriver(org.openqa.selenium.WebDriver) PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) Test(org.junit.Test)

Example 20 with PageModeMenuCommand

use of com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminCountryTest.

/**
 * Site admin country test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminCountryTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    loginAsAdmin(userPageVisit);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Country"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, ""));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) Test(org.junit.Test)

Aggregations

PageModeMenuCommand (com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand)151 Test (org.junit.Test)135 WebDriver (org.openqa.selenium.WebDriver)135 WebElement (org.openqa.selenium.WebElement)12 ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)7 MenuItem (com.vaadin.ui.MenuBar.MenuItem)7 ViewWorldbankIndicatorDataCountrySummary (com.hack23.cia.model.internal.application.data.impl.ViewWorldbankIndicatorDataCountrySummary)1 ViewWorldbankIndicatorDataCountrySummary_ (com.hack23.cia.model.internal.application.data.impl.ViewWorldbankIndicatorDataCountrySummary_)1 WorldbankIndicatorDataCountrySummaryEmbeddedId (com.hack23.cia.model.internal.application.data.impl.WorldbankIndicatorDataCountrySummaryEmbeddedId)1 WorldbankIndicatorDataCountrySummaryEmbeddedId_ (com.hack23.cia.model.internal.application.data.impl.WorldbankIndicatorDataCountrySummaryEmbeddedId_)1 ApplicationManager (com.hack23.cia.service.api.ApplicationManager)1 DataContainer (com.hack23.cia.service.api.DataContainer)1 ApplicationMenuItemFactory (com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.ApplicationMenuItemFactory)1 CountryMenuItemFactory (com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.CountryMenuItemFactory)1 ContentRatio (com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio)1 PageMode (com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode)1 UserViews (com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews)1 VaadinIcons (com.vaadin.icons.VaadinIcons)1 Alignment (com.vaadin.ui.Alignment)1 MenuBar (com.vaadin.ui.MenuBar)1