Search in sources :

Example 1 with BinderPage

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

the class PortfolioV2Test method binderInvitation.

/**
 * A user create a binder with some sections and pages.
 * It invites a second person on the last page it creates.
 * This page is not published for the moment. The invitee
 * follow the invitation URL and see an empty binder.<br>
 *  The author publish the last entry. The invitee come back
 *  to the list of entries, find the page and open it.
 *
 * @param loginPage
 * @param inviteeBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void binderInvitation(@InitialPage LoginPage loginPage, @Drone @User WebDriver inviteeBrowser) 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 on invitation " + UUID.randomUUID();
    BinderPage binder = portfolio.openMyBinders().createBinder(binderTitle, "A brand new binder");
    // create 2 sections and 3 entries
    binder.selectEntries().createSection("1. Section").assertOnSectionTitleInEntries("1. Section").createEntry("1. Page").assertOnPage("1. Page").selectEntries().createSection("2. Section").createEntry("2. Page").assertOnPage("2. Page").selectEntries().createEntry("3. Page", 1).assertOnPage("3. Page");
    BinderPublicationPage binderPublish = binder.selectPublish().openAccessMenu().addInvitation("c.l@frentix.com").fillInvitation("Clara", "Vigne").fillAccessRights("3. Page", Boolean.TRUE);
    String url = binderPublish.getInvitationURL();
    binderPublish.save();
    // invitee come to see the bidner
    inviteeBrowser.get(url);
    BinderPage invitee = new BinderPage(inviteeBrowser);
    invitee.assertOnBinder().selectEntries().assertNoPagesInEntries();
    // author publish an entry
    binder.selectTableOfContent().selectEntryInToc("3. Page").publishEntry();
    // return in entries to check the changes
    invitee.selectTableOfContent().selectEntries().assertOnPageInEntries("3. Page").selectEntryInEntries("3. Page").assertOnPage("3. Page");
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) BinderPublicationPage(org.olat.selenium.page.portfolio.BinderPublicationPage) 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 2 with BinderPage

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

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)

Example 3 with BinderPage

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

the class PortfolioV2Test method deletePage.

/**
 * A user create a binder with a section and two pages. It deletes
 * one, go to the trash, find the delete page, restore it and go
 * again in the binder. It move a second time the page to the trash
 * and delete it definitively.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void deletePage(@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 del " + UUID.randomUUID();
    BinderPage binder = portfolio.openMyBinders().createBinder(binderTitle, "A binder where I want to delete some pages");
    String sectionTitle = "Section one " + UUID.randomUUID();
    binder.selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle);
    String pageTitle = "Page two " + UUID.randomUUID();
    String pageToDelete = "Page del " + UUID.randomUUID();
    binder.createEntry(pageToDelete).assertOnPage(pageToDelete).selectEntries().createEntry(pageTitle).assertOnPage(pageTitle).selectTableOfContent().selectEntryInToc(pageToDelete).moveEntryToTrash().assertOnPageInToc(pageTitle).assertOnPageNotInToc(pageToDelete);
    EntriesPage trash = portfolio.clickToolbarBack().clickToolbarBack().openDeletedEntries();
    trash.assertOnPage(pageToDelete).switchTableView().restore(pageToDelete, binderTitle, sectionTitle);
    portfolio.clickToolbarBack().openMyBinders().selectBinder(binderTitle).assertOnPageInToc(pageToDelete).selectEntryInToc(pageToDelete).moveEntryToTrash();
    trash = portfolio.clickToolbarBack().clickToolbarBack().openDeletedEntries();
    trash.switchTableView().assertOnPageTableView(pageToDelete).switchTableView().selectPageInTableView(pageToDelete).deleteEntry().assertEmptyTableView();
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) EntriesPage(org.olat.selenium.page.portfolio.EntriesPage) 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 4 with BinderPage

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

the class PortfolioV2Test method binderAssessment.

/**
 * This is a long test. It's test the whole process to assess a binder from
 * the template create by the author, to the assessment value saved in the
 * assessment tool of the course.<br>
 * The author creates a portfolio template with 2 sections and 2 assignments,
 * it creates a course with a portfolio element and bind the template to it. It
 * add a user as participant.<br>
 * The participant starts the course, pick the binder and do every assignment.
 * It edits the sharing settings to add the author as a coach.<br>
 * The author assesses the sections and set the binder as done. Than it goes
 * to the course, opens the assessment tool and check the participant passed
 * the binder.
 *
 * @param loginPage
 * @param reiBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void binderAssessment(@InitialPage LoginPage loginPage, @Drone @User WebDriver reiBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("rei");
    loginPage.loginAs(author.getLogin(), author.getPassword()).resume();
    String binderTitle = "Binder to assess " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createPortfolioBinder(binderTitle).clickToolbarBack();
    // create a binder template with 2 sections and
    // an assignment in each
    String section1Title = "Section 1 " + UUID.randomUUID();
    String assignment1Title = "Assignment 1 " + UUID.randomUUID();
    String section2Title = "Section 2 " + UUID.randomUUID();
    String assignment2Title = "Assignment 2 " + UUID.randomUUID();
    BinderPage binderTemplate = new BinderPage(browser);
    binderTemplate.assertOnBinder().selectTableOfContent().deleteSection().selectEntries().createSectionInEntries(section1Title).createAssignmentForSection(section1Title, assignment1Title, "Write a small summary", "Your task is...").assertOnAssignmentInEntries(assignment1Title).createSection(section2Title).createAssignmentForSection(section2Title, assignment2Title, "Second part to do", "you have to work").assertOnAssignmentInEntries(assignment2Title);
    // create a course
    String courseTitle = "ASPF Course " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String portfolioNodeTitle = "Template-ASPF-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);
    // configure the assessment
    AssessmentCEConfigurationPage assessmentConfig = new AssessmentCEConfigurationPage(browser);
    assessmentConfig.selectConfiguration().setScoreAuto(0.0f, 10.0f, 5.0f);
    courseEditor.publish().quickPublish(UserAccess.membersOnly);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    membersPage.importMembers().setMembers(rei).nextUsers().nextOverview().nextPermissions().finish();
    // Participant log in
    LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
    reiLoginPage.loginAs(rei).resume();
    // open the course
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openMyCourses().select(courseTitle);
    // go to the portfolio course element
    CoursePageFragment reiTestCourse = new CoursePageFragment(reiBrowser);
    reiTestCourse.clickTree().selectWithTitle(portfolioNodeTitle);
    PortfolioElementPage portfolioCourseEl = new PortfolioElementPage(reiBrowser);
    BinderPage reiBinder = portfolioCourseEl.pickPortfolio().goToPortfolioV2();
    OOGraphene.waitAndCloseBlueMessageWindow(reiBrowser);
    reiBinder.selectEntries().pickAssignment(assignment1Title).publishEntry();
    reiBinder.selectEntries().pickAssignment(assignment2Title).publishEntry();
    // add the author as coach
    reiBinder.selectPublish().openAccessMenu().addMember().searchMember(author, false).nextUsers().nextOverview().fillAccessRights(binderTitle, Boolean.TRUE).nextPermissions().deSelectEmail().finish();
    // the author come to see the binder
    UserToolsPage userTools = new UserToolsPage(browser);
    PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
    portfolio.openSharedWithMe().openSharedBindersWithMe().assertOnBinder(binderTitle).selectBinder(binderTitle).selectAssessment().passed(section1Title).save().close(section1Title).passed(section2Title).save().close(section2Title).done().assertPassed(2);
    // than go to the course and check the results in the assessment tool
    // author take the lead and check the assessment tool
    navBar.openMyCourses().select(courseTitle);
    // open the assessment tool
    AssessmentToolPage assessmentTool = new CoursePageFragment(browser).assessmentTool();
    // check that rei has passed the test
    assessmentTool.users().assertOnUsers(rei).selectUser(rei).assertPassed(rei);
}
Also used : AssessmentCEConfigurationPage(org.olat.selenium.page.course.AssessmentCEConfigurationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) 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) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserToolsPage(org.olat.selenium.page.user.UserToolsPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) MembersPage(org.olat.selenium.page.course.MembersPage) PortfolioV2HomePage(org.olat.selenium.page.portfolio.PortfolioV2HomePage) AssessmentToolPage(org.olat.selenium.page.course.AssessmentToolPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 5 with BinderPage

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

the class PortfolioV2Test method deletePage.

/**
 * A user create a binder with a section and two pages. It deletes
 * one, go to the trash, find the delete page, restore it and go
 * again in the binder. It move a second time the page to the trash
 * and delete it definitively.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void deletePage(@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 del " + UUID.randomUUID();
    BinderPage binder = portfolio.openMyBinders().createBinder(binderTitle, "A binder where I want to delete some pages");
    String sectionTitle = "Section one " + UUID.randomUUID();
    binder.selectEntries().createSection(sectionTitle).assertOnSectionTitleInEntries(sectionTitle);
    String pageTitle = "Page two " + UUID.randomUUID();
    String pageToDelete = "Page del " + UUID.randomUUID();
    binder.createEntry(pageToDelete).assertOnPage(pageToDelete).selectEntries().createEntry(pageTitle).assertOnPage(pageTitle).selectTableOfContent().selectEntryInToc(pageToDelete).moveEntryToTrash().assertOnPageInToc(pageTitle).assertOnPageNotInToc(pageToDelete);
    EntriesPage trash = portfolio.clickToolbarBack().clickToolbarBack().openDeletedEntries();
    trash.assertOnPage(pageToDelete).switchTableView().restore(pageToDelete, binderTitle, sectionTitle);
    portfolio.clickToolbarBack().openMyBinders().selectBinder(binderTitle).assertOnPageInToc(pageToDelete).selectEntryInToc(pageToDelete).moveEntryToTrash();
    trash = portfolio.clickToolbarBack().clickToolbarBack().openDeletedEntries();
    trash.switchTableView().assertOnPageTableView(pageToDelete).switchTableView().selectPageInTableView(pageToDelete).deleteEntry().assertEmptyTableView();
}
Also used : UserToolsPage(org.olat.selenium.page.user.UserToolsPage) EntriesPage(org.olat.selenium.page.portfolio.EntriesPage) 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)

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