Search in sources :

Example 6 with PageModeMenuCommand

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

the class UserHomeMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout overviewLayout) {
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    createButtonLink(grid, SECURITY_SETTING_TEXT, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.SECURITY_SETTINGS.toString(), ""), "Security settings, enable MFA");
    createButtonLink(grid, USER_VISITS, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.USER_VISITS.toString()), "All past visits");
    createButtonLink(grid, USER_EVENTS, VaadinIcons.USER, new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.USER_EVENTS.toString()), "All past events");
}
Also used : PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Example 7 with PageModeMenuCommand

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

the class AbstractRoleSystemTest method loginAsAdmin.

/**
 * Login as admin.
 *
 * @param userPageVisit
 *            the user page visit
 * @throws Exception
 *             the exception
 */
protected final void loginAsAdmin(final UserPageVisit userPageVisit) throws Exception {
    userPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.LOGIN.toString()));
    userPageVisit.loginUser(systemTestTargetAdminEmail, systemTestTargetAdminPassword);
}
Also used : PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand)

Example 8 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 siteAdminPortalTest.

/**
 * Site admin portal test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminPortalTest() 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_PORTAL_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Portal"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_PORTAL_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 9 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 visitAdminDataSummaryViewRemoveApplicationHistoryTest.

/**
 * Visit admin data summary view remove application history test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void visitAdminDataSummaryViewRemoveApplicationHistoryTest() 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 removeApplicationHistoryButton = userPageVisit.findButton("Remove Application History");
    assertNotNull("Expect to find a Button", removeApplicationHistoryButton);
// userPageVisit.performClickAction(removeApplicationHistoryButton);
}
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 10 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 siteAdminLanguageTest.

/**
 * Site admin language test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminLanguageTest() 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_LANGUAGE_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Language"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_LANGUAGE_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