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);
}
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();
}
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;
}
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);
}
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);
}
Aggregations