Search in sources :

Example 6 with BinderPage

use of org.olat.selenium.page.portfolio.BinderPage in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method createSimpleBinder.

/**
 * A user create a simple binder with section and page.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createSimpleBinder(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createRandomUser("rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    UserToolsPage userTools = new UserToolsPage(browser);
    PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
    String binderTitle = "First binder " + UUID.randomUUID();
    BinderPage binder = portfolio.openMyBinders().createBinder(binderTitle, "A brand new binder");
    String sectionTitle = "Section one " + UUID.randomUUID();
    binder.selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle);
    String pageTitle = "Page one " + UUID.randomUUID();
    binder.createEntry(pageTitle).assertOnPage(pageTitle);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 7 with BinderPage

use of org.olat.selenium.page.portfolio.BinderPage in project OpenOLAT by OpenOLAT.

the class PortfolioV2Test method deleteBinder.

/**
 * A user create a binder with section and pages, move it to
 * the trash. Then it goes to the trash restore it. Return to
 * the list of binders, move the binder again to the trash and
 * goes there to delete it definitively.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void deleteBinder(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createRandomUser("rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    UserToolsPage userTools = new UserToolsPage(browser);
    PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
    String binderTitle = "Binder ephemere " + UUID.randomUUID();
    BindersPage myBinders = portfolio.openMyBinders();
    BinderPage binder = myBinders.createBinder(binderTitle, "A binder that I want to delete");
    String sectionTitle = "Section one " + UUID.randomUUID();
    binder.selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle);
    for (int i = 1; i < 3; i++) {
        String pageTitle = "Page " + i;
        binder.createEntry(pageTitle).assertOnPage(pageTitle).selectEntries();
    }
    binder.selectTableOfContent().selectEntryInToc("Page 1");
    // reload the binder
    portfolio.clickToolbarBack().clickToolbarBack();
    myBinders.selectBinder(binderTitle);
    // move the binder to the trash
    binder.assertOnPageInToc("Page 1").moveBinderToTrash();
    // go in the trash to restore it
    portfolio.clickToolbarBack().openDeletedBinders().switchTableView().restoreBinder(binderTitle);
    // move it to the trash again
    portfolio.clickToolbarBack().openMyBinders().selectBinder(binderTitle).moveBinderToTrash();
    // go to the trash to delete it definitively
    portfolio.clickToolbarBack().openDeletedBinders().selectBinderInTableView(binderTitle).assertOnPageInToc("Page 2").deleteBinder().assertEmptyTableView();
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) BindersPage(org.olat.selenium.page.portfolio.BindersPage) UserVO(org.olat.user.restapi.UserVO) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 8 with BinderPage

use of org.olat.selenium.page.portfolio.BinderPage in project OpenOLAT by OpenOLAT.

the class PortfolioElementPage method goToPortfolioV2.

public BinderPage goToPortfolioV2() {
    By openBy = By.cssSelector("a.o_sel_ep_select_map");
    OOGraphene.waitElement(openBy, 5, browser);
    browser.findElement(openBy).click();
    OOGraphene.waitBusy(browser);
    BinderPage binderPage = new BinderPage(browser);
    binderPage.assertOnBinder();
    return binderPage;
}
Also used : By(org.openqa.selenium.By) BinderPage(org.olat.selenium.page.portfolio.BinderPage)

Example 9 with BinderPage

use of org.olat.selenium.page.portfolio.BinderPage in project openolat by klemens.

the class PortfolioV2Test method createSimpleBinder.

/**
 * A user create a simple binder with section and page.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createSimpleBinder(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createRandomUser("rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    UserToolsPage userTools = new UserToolsPage(browser);
    PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
    String binderTitle = "First binder " + UUID.randomUUID();
    BinderPage binder = portfolio.openMyBinders().createBinder(binderTitle, "A brand new binder");
    String sectionTitle = "Section one " + UUID.randomUUID();
    binder.selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle);
    String pageTitle = "Page one " + UUID.randomUUID();
    binder.createEntry(pageTitle).assertOnPage(pageTitle);
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 10 with BinderPage

use of org.olat.selenium.page.portfolio.BinderPage in project openolat by klemens.

the class PortfolioV2Test method createTemplate.

/**
 * Create a portfolio, a course with a portoflio course element,
 * publish it, ad a participant. The participant log in, search
 * the course and pick the portfolio.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createTemplate(@InitialPage LoginPage loginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("ryomou");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    String binderTitle = "PF-Binder-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
    String sectionTitle = "Section 1 " + UUID.randomUUID();
    String assignmentTitle = "Assignment 1 " + UUID.randomUUID();
    BinderPage portfolio = new BinderPage(browser);
    portfolio.assertOnBinder().selectEntries().createSectionInEntries(sectionTitle).createAssignmentForSection(sectionTitle, assignmentTitle, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignmentTitle);
    String courseTitle = "PF Course " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String portfolioNodeTitle = "Template-EP-v2";
    // create a course element of type portfolio and choose the one we created above
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("ep").nodeTitle(portfolioNodeTitle).selectTabLearnContent().choosePortfolio(binderTitle).publish().quickPublish(UserAccess.membersOnly);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    membersPage.importMembers().setMembers(ryomou).nextUsers().nextOverview().nextPermissions().finish();
    // Participant log in
    LoginPage ryomouLoginPage = LoginPage.getLoginPage(ryomouBrowser, deploymentUrl);
    ryomouLoginPage.loginAs(ryomou).resume();
    // open the course
    NavigationPage ryomouNavBar = new NavigationPage(ryomouBrowser);
    ryomouNavBar.openMyCourses().select(courseTitle);
    // go to the portfolio course element
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
    PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(ryomouBrowser);
    BinderPage binder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
    binder.selectEntries().pickAssignment(assignmentTitle);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) MembersPage(org.olat.selenium.page.course.MembersPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) BinderPage(org.olat.selenium.page.portfolio.BinderPage) PortfolioElementPage(org.olat.selenium.page.course.PortfolioElementPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

BinderPage (org.olat.selenium.page.portfolio.BinderPage)14 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)12 Test (org.junit.Test)12 UserRestClient (org.olat.test.rest.UserRestClient)12 UserVO (org.olat.user.restapi.UserVO)12 PortfolioV2HomePage (org.olat.selenium.page.portfolio.PortfolioV2HomePage)10 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)10 LoginPage (org.olat.selenium.page.LoginPage)4 NavigationPage (org.olat.selenium.page.NavigationPage)4 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)4 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)4 MembersPage (org.olat.selenium.page.course.MembersPage)4 PortfolioElementPage (org.olat.selenium.page.course.PortfolioElementPage)4 AssessmentCEConfigurationPage (org.olat.selenium.page.course.AssessmentCEConfigurationPage)2 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)2 BinderPublicationPage (org.olat.selenium.page.portfolio.BinderPublicationPage)2 BindersPage (org.olat.selenium.page.portfolio.BindersPage)2 EntriesPage (org.olat.selenium.page.portfolio.EntriesPage)2 By (org.openqa.selenium.By)2