use of com.hack23.cia.web.impl.ui.application.action.ViewAction in project cia by Hack23.
the class AdminRoleSystemTest method siteAdminAgentOperationTest.
/**
* Site admin test.
*
* @throws Exception
* the exception
*/
@Test
public void siteAdminAgentOperationTest() 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_AGENT_OPERATIONVIEW_NAME, ""));
userPageVisit.verifyViewActions(new ViewAction[] { ViewAction.VISIT_MAIN_VIEW });
final WebElement importWorldBankDataButton = userPageVisit.findButton("Start IMPORT MODEL_EXTERNAL_WORLDBANK");
assertNotNull("Start IMPORT MODEL_EXTERNAL_WORLDBANK Button", importWorldBankDataButton);
final WebElement importRiksdagenDataButton = userPageVisit.findButton("Start IMPORT MODEL_EXTERNAL_RIKSDAGEN");
assertNotNull("Start IMPORT MODEL_EXTERNAL_RIKSDAGEN Button", importRiksdagenDataButton);
userPageVisit.performClickAction(importRiksdagenDataButton);
}
use of com.hack23.cia.web.impl.ui.application.action.ViewAction in project cia by Hack23.
the class PageActionEventHelperImpl method createPageEvent.
@Override
public void createPageEvent(final ViewAction viewAction, final ApplicationEventGroup applicationEventGroup, final String page, final String pageMode, final String elementId) {
String pageModeToUse;
if (pageMode != null && elementId != null && pageMode.contains(elementId)) {
pageModeToUse = pageMode.replace(elementId, "").replace("/", "");
} else {
pageModeToUse = pageMode;
}
if ((pageModeToUse == null || "".equals(pageModeToUse)) && ApplicationEventGroup.USER == applicationEventGroup) {
pageModeToUse = "Overview";
}
final CreateApplicationEventRequest serviceRequest = new CreateApplicationEventRequest();
serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
serviceRequest.setEventGroup(applicationEventGroup);
serviceRequest.setApplicationOperation(ApplicationOperationType.READ);
serviceRequest.setPage(StringUtils.defaultString(page));
serviceRequest.setPageMode(StringUtils.defaultString(pageModeToUse));
serviceRequest.setElementId(StringUtils.defaultString(elementId));
serviceRequest.setActionName(viewAction.toString());
serviceRequest.setUserId(UserContextUtil.getUserIdFromSecurityContext());
serviceRequest.setApplicationMessage(viewAction.toString());
applicationManager.service(serviceRequest);
}
Aggregations