use of org.olat.selenium.page.portfolio.EntryPage in project OpenOLAT by OpenOLAT.
the class PortfolioV2Test method editPage.
/**
* A user create a page / entry, it edit it
* and add a title, an image, a document
* and a citation. It toggles between the editor
* mode and the view mode to check if the parts it
* add in the page are really there.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void editPage(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser("rei");
loginPage.loginAs(user.getLogin(), user.getPassword()).resume();
UserToolsPage userTools = new UserToolsPage(browser);
PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
String pageTitle = "My page " + UUID.randomUUID();
EntryPage entry = portfolio.openMyEntries().newPage(pageTitle).assertOnPage(pageTitle);
// add a title
String title = "My long title " + UUID.randomUUID();
entry.addTitle(title).setTitleSize(4).closeEditFragment().assertOnTitle(title, 4);
// add an image
URL imageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File imageFile = new File(imageUrl.toURI());
entry.addImage("Blue is the new black", imageFile).assertOnImage(imageFile);
// close the editor and check
entry.toggleEditor().assertOnTitle(title, 4).assertOnImage(imageFile);
// reopen the editor and add a document
URL pdfUrl = JunitTestHelper.class.getResource("file_resources/handInTopic1.pdf");
File pdfFile = new File(pdfUrl.toURI());
entry.toggleEditor().addDocument("Anything about", pdfFile).assertOnDocument(pdfFile);
// and a citation
String citation = "Close the world, open the next.";
entry.addCitation("Serial experiment", citation).assertOnCitation(citation);
// close the editor and check all parts
entry.toggleEditor().assertOnTitle(title, 4).assertOnImage(imageFile).assertOnDocument(pdfFile).assertOnCitation(citation);
}
use of org.olat.selenium.page.portfolio.EntryPage in project openolat by klemens.
the class PortfolioV2Test method editPage.
/**
* A user create a page / entry, it edit it
* and add a title, an image, a document
* and a citation. It toggles between the editor
* mode and the view mode to check if the parts it
* add in the page are really there.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void editPage(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser("rei");
loginPage.loginAs(user.getLogin(), user.getPassword()).resume();
UserToolsPage userTools = new UserToolsPage(browser);
PortfolioV2HomePage portfolio = userTools.openUserToolsMenu().openPortfolioV2();
String pageTitle = "My page " + UUID.randomUUID();
EntryPage entry = portfolio.openMyEntries().newPage(pageTitle).assertOnPage(pageTitle);
// add a title
String title = "My long title " + UUID.randomUUID();
entry.addTitle(title).setTitleSize(4).closeEditFragment().assertOnTitle(title, 4);
// add an image
URL imageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File imageFile = new File(imageUrl.toURI());
entry.addImage("Blue is the new black", imageFile).assertOnImage(imageFile);
// close the editor and check
entry.toggleEditor().assertOnTitle(title, 4).assertOnImage(imageFile);
// reopen the editor and add a document
URL pdfUrl = JunitTestHelper.class.getResource("file_resources/handInTopic1.pdf");
File pdfFile = new File(pdfUrl.toURI());
entry.toggleEditor().addDocument("Anything about", pdfFile).assertOnDocument(pdfFile);
// and a citation
String citation = "Close the world, open the next.";
entry.addCitation("Serial experiment", citation).assertOnCitation(citation);
// close the editor and check all parts
entry.toggleEditor().assertOnTitle(title, 4).assertOnImage(imageFile).assertOnDocument(pdfFile).assertOnCitation(citation);
}
Aggregations