Search in sources :

Example 11 with UserAccount

use of com.hack23.cia.model.internal.application.user.impl.UserAccount in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminUseraccountDeleteTest.

/**
 * Site admin useraccount delete test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminUseraccountDeleteTest() 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_USERACCOUNT_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Useraccount"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, ""));
    final WebElement deleteButton = userPageVisit.findButton("Perform DELETE");
    assertNotNull("Expect to find a Delete Button", deleteButton);
    userPageVisit.performClickAction(deleteButton);
    userPageVisit.checkNotificationMessage("Operation completed");
}
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 12 with UserAccount

use of com.hack23.cia.model.internal.application.user.impl.UserAccount in project cia by Hack23.

the class UserRoleSystemTest method siteLoginUserCheckUserVisitsTest.

/**
 * Site login user check user visits test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteLoginUserCheckUserVisitsTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString()));
    final String username = UUID.randomUUID().toString();
    final String password = generatePassword();
    userPageVisit.registerNewUser(username, password);
    userPageVisit.logoutUser();
    driver.quit();
    final WebDriver loginDriver = getWebDriver();
    final UserPageVisit userLoginPageVisit = new UserPageVisit(loginDriver, browser);
    userLoginPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.LOGIN.toString()));
    userLoginPageVisit.loginUser(username + "@test.com", password);
    final WebElement useraccountMenuItem = userLoginPageVisit.getMenuItem("Useraccount");
    assertNotNull(useraccountMenuItem);
    userLoginPageVisit.performClickAction(useraccountMenuItem);
    Thread.sleep(1000);
    final WebElement userVisitsMenuItem = userLoginPageVisit.getMenuItem("User Visits");
    assertNotNull(userVisitsMenuItem);
    userLoginPageVisit.performClickAction(userVisitsMenuItem);
    userLoginPageVisit.logoutUser();
}
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 13 with UserAccount

use of com.hack23.cia.model.internal.application.user.impl.UserAccount in project cia by Hack23.

the class UserRoleSystemTest method siteLoginUserEnableGoogleAuthenticatorTest.

/**
 * Site login user enable google authenticator test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteLoginUserEnableGoogleAuthenticatorTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString()));
    final String username = UUID.randomUUID().toString();
    final String password = generatePassword();
    userPageVisit.registerNewUser(username, password);
    userPageVisit.logoutUser();
    driver.quit();
    final WebDriver loginDriver = getWebDriver();
    final UserPageVisit userLoginPageVisit = new UserPageVisit(loginDriver, browser);
    userLoginPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.LOGIN.toString()));
    userLoginPageVisit.loginUser(username + "@test.com", password);
    final WebElement userAccountMenuItem = userLoginPageVisit.getMenuItem("Useraccount");
    assertNotNull(userAccountMenuItem);
    userLoginPageVisit.performClickAction(userAccountMenuItem);
    Thread.sleep(1000);
    final WebElement securitySettingMenuItem = userLoginPageVisit.getMenuItem("Security settings");
    assertNotNull(securitySettingMenuItem);
    userLoginPageVisit.performClickAction(securitySettingMenuItem);
    userLoginPageVisit.enableGoogleAuthenticator();
    userLoginPageVisit.logoutUser();
}
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 14 with UserAccount

use of com.hack23.cia.model.internal.application.user.impl.UserAccount in project cia by Hack23.

the class UserRoleSystemTest method siteLoginUserDisableGoogleAuthenticatorTest.

@Test
public void siteLoginUserDisableGoogleAuthenticatorTest() throws Exception {
    final WebDriver driver = getWebDriver();
    assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
    final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
    userPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString()));
    final String username = UUID.randomUUID().toString();
    final String password = generatePassword();
    userPageVisit.registerNewUser(username, password);
    userPageVisit.logoutUser();
    driver.quit();
    final WebDriver loginDriver = getWebDriver();
    final UserPageVisit userLoginPageVisit = new UserPageVisit(loginDriver, browser);
    userLoginPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.LOGIN.toString()));
    userLoginPageVisit.loginUser(username + "@test.com", password);
    final WebElement userAccountMenuItem = userLoginPageVisit.getMenuItem("Useraccount");
    assertNotNull(userAccountMenuItem);
    userLoginPageVisit.performClickAction(userAccountMenuItem);
    Thread.sleep(1000);
    final WebElement securitySettingMenuItem = userLoginPageVisit.getMenuItem("Security settings");
    assertNotNull(securitySettingMenuItem);
    userLoginPageVisit.performClickAction(securitySettingMenuItem);
    userLoginPageVisit.disableGoogleAuthenticator();
    userLoginPageVisit.logoutUser();
}
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 15 with UserAccount

use of com.hack23.cia.model.internal.application.user.impl.UserAccount in project cia by Hack23.

the class AdminRoleSystemTest method siteAdminUseraccountTest.

/**
 * Site admin useraccount test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void siteAdminUseraccountTest() 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_USERACCOUNT_VIEW_NAME, ""));
    assertTrue("Expect content", userPageVisit.checkHtmlBodyContainsText("Useraccount"));
    clickFirstRowInGrid(userPageVisit);
    userPageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_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

UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)37 Test (org.junit.Test)19 Secured (org.springframework.security.access.annotation.Secured)18 CreateApplicationEventRequest (com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)14 RegisterUserResponse (com.hack23.cia.service.api.action.application.RegisterUserResponse)14 CreateApplicationSessionRequest (com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest)13 RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)13 AbstractServiceFunctionalIntegrationTest (com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest)13 PerfTest (org.databene.contiperf.PerfTest)10 LoginResponse (com.hack23.cia.service.api.action.application.LoginResponse)8 LoginRequest (com.hack23.cia.service.api.action.application.LoginRequest)7 PageModeMenuCommand (com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand)7 ManageUserAccountResponse (com.hack23.cia.service.api.action.admin.ManageUserAccountResponse)6 ArrayList (java.util.ArrayList)6 WebDriver (org.openqa.selenium.WebDriver)6 ManageUserAccountRequest (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest)5 Required (org.databene.contiperf.Required)5 LogoutRequest (com.hack23.cia.service.api.action.application.LogoutRequest)4 VerticalLayout (com.vaadin.ui.VerticalLayout)4 WebElement (org.openqa.selenium.WebElement)4