use of org.olat.selenium.page.user.PortalPage in project OpenOLAT by OpenOLAT.
the class UserTest method movePortletToTheTop.
/**
* Go to the portal, edit it, move the notes to the
* top, quit editing, check the notes are the first
* portlet in the view mode.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void movePortletToTheTop(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword());
PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.notesBy).edit().moveLeft(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveRight(PortalPage.quickStartBy).moveDown(PortalPage.quickStartBy);
// finish editing
portal.finishEditing();
// no inactive panel -> we are in view mode
List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
Assert.assertTrue(portalInactive.isEmpty());
// notes must be first
List<WebElement> portlets = browser.findElements(By.className("o_portlet"));
Assert.assertFalse(portlets.isEmpty());
WebElement notesPortlet = portlets.get(0);
String cssClass = notesPortlet.getAttribute("class");
Assert.assertNotNull(cssClass);
Assert.assertTrue(cssClass.contains("o_portlet_notes"));
}
use of org.olat.selenium.page.user.PortalPage in project OpenOLAT by OpenOLAT.
the class UserTest method portletDeactivateActivate.
/**
* Go in portal, edit it, deactivate the quick start portlet,
* finish editing, check that the quick start portlet disappears,
* re-edit, reactivate the quick start portlet and check it is
* again in the non-edit view.
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void portletDeactivateActivate(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword());
PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.quickStartBy).edit().disable(PortalPage.quickStartBy).finishEditing().assertNotPortlet(PortalPage.quickStartBy);
// re-enable quickstart
portal.edit().enable(PortalPage.quickStartBy).finishEditing().assertPortlet(PortalPage.quickStartBy);
List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
Assert.assertTrue(portalInactive.isEmpty());
}
use of org.olat.selenium.page.user.PortalPage in project openolat by klemens.
the class UserTest method movePortletToTheTop.
/**
* Go to the portal, edit it, move the notes to the
* top, quit editing, check the notes are the first
* portlet in the view mode.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void movePortletToTheTop(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword());
PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.notesBy).edit().moveLeft(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveRight(PortalPage.quickStartBy).moveDown(PortalPage.quickStartBy);
// finish editing
portal.finishEditing();
// no inactive panel -> we are in view mode
List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
Assert.assertTrue(portalInactive.isEmpty());
// notes must be first
List<WebElement> portlets = browser.findElements(By.className("o_portlet"));
Assert.assertFalse(portlets.isEmpty());
WebElement notesPortlet = portlets.get(0);
String cssClass = notesPortlet.getAttribute("class");
Assert.assertNotNull(cssClass);
Assert.assertTrue(cssClass.contains("o_portlet_notes"));
}
use of org.olat.selenium.page.user.PortalPage in project openolat by klemens.
the class UserTest method portletDeactivateActivate.
/**
* Go in portal, edit it, deactivate the quick start portlet,
* finish editing, check that the quick start portlet disappears,
* re-edit, reactivate the quick start portlet and check it is
* again in the non-edit view.
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void portletDeactivateActivate(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword());
PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.quickStartBy).edit().disable(PortalPage.quickStartBy).finishEditing().assertNotPortlet(PortalPage.quickStartBy);
// re-enable quickstart
portal.edit().enable(PortalPage.quickStartBy).finishEditing().assertPortlet(PortalPage.quickStartBy);
List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
Assert.assertTrue(portalInactive.isEmpty());
}
Aggregations