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");
}
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();
}
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();
}
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();
}
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, ""));
}
Aggregations