/** Test login panel is displayed when a user tries to access an Alfresco share page. */ @Test public void pageShouldDisplayLoginPanel() { SharePage page; try { drone.navigateTo(shareUrl); page = drone.getCurrentPage().render(); Assert.assertTrue(page.isBrowserTitle("login")); } catch (Exception e) { logger.error(e); } finally { page = null; } }
/** * Log a user into Alfresco with valid credentials and then logout * * @throws Exception if error */ @Test public void loginAndLogout() throws Exception { drone.navigateTo(shareUrl); LoginPage page = drone.getCurrentPage().render(); Assert.assertTrue(page.isBrowserTitle("login")); Assert.assertFalse(page.hasErrorMessage()); DashBoardPage dashboardPage = (DashBoardPage) ShareUtil.loginAs(drone, shareUrl, username, password); dashboardPage.render(); Assert.assertFalse(page.isBrowserTitle("login")); Assert.assertTrue(dashboardPage.isBrowserTitle("dashboard")); Assert.assertTrue(dashboardPage.isLoggedIn()); SharePage pageResponse = dashboardPage.getNav().logout().render(); Assert.assertTrue(pageResponse.isBrowserTitle("login")); }