Search in sources :

Example 1 with PortalPage

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"));
}
Also used : UserVO(org.olat.user.restapi.UserVO) WebElement(org.openqa.selenium.WebElement) PortalPage(org.olat.selenium.page.user.PortalPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 2 with PortalPage

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());
}
Also used : UserVO(org.olat.user.restapi.UserVO) WebElement(org.openqa.selenium.WebElement) PortalPage(org.olat.selenium.page.user.PortalPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 3 with PortalPage

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"));
}
Also used : UserVO(org.olat.user.restapi.UserVO) WebElement(org.openqa.selenium.WebElement) PortalPage(org.olat.selenium.page.user.PortalPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 4 with PortalPage

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());
}
Also used : UserVO(org.olat.user.restapi.UserVO) WebElement(org.openqa.selenium.WebElement) PortalPage(org.olat.selenium.page.user.PortalPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)4 Test (org.junit.Test)4 PortalPage (org.olat.selenium.page.user.PortalPage)4 UserRestClient (org.olat.test.rest.UserRestClient)4 UserVO (org.olat.user.restapi.UserVO)4 WebElement (org.openqa.selenium.WebElement)4