use of org.olat.selenium.page.core.FolderPage in project openolat by klemens.
the class ParticipantFolderPage method openReturnBox.
public FolderPage openReturnBox() {
By returnBoxBy = By.xpath("//div[@class='o_briefcase_folder']//table/tbody/tr[1]/td/a[i[contains(@class,'o_filetype_folder')]]");
OOGraphene.waitElement(returnBoxBy, browser);
browser.findElement(returnBoxBy).click();
OOGraphene.waitBusy(browser);
return new FolderPage(browser);
}
use of org.olat.selenium.page.core.FolderPage in project OpenOLAT by OpenOLAT.
the class ParticipantFolderPage method openReturnBox.
public FolderPage openReturnBox() {
By returnBoxBy = By.xpath("//div[@class='o_briefcase_folder']//table/tbody/tr[1]/td/a[i[contains(@class,'o_filetype_folder')]]");
OOGraphene.waitElement(returnBoxBy, browser);
browser.findElement(returnBoxBy).click();
OOGraphene.waitBusy(browser);
return new FolderPage(browser);
}
use of org.olat.selenium.page.core.FolderPage in project OpenOLAT by OpenOLAT.
the class ParticipantFolderPage method openDropBox.
public FolderPage openDropBox() {
By returnBoxBy = By.xpath("//div[@class='o_briefcase_folder']//table/tbody/tr[2]/td/a[i[contains(@class,'o_filetype_folder')]]");
OOGraphene.waitElement(returnBoxBy, browser);
browser.findElement(returnBoxBy).click();
OOGraphene.waitBusy(browser);
return new FolderPage(browser);
}
use of org.olat.selenium.page.core.FolderPage in project OpenOLAT by OpenOLAT.
the class CourseElementTest method createCourseWithParticipantFolder.
/**
* An author create a course with a participant folder course
* element. It add a participant to the course and upload file
* in the return box of this participant.<br>
* The participant come in and open the course, see the file
* uploaded by the author in its return box and it uploads an
* image in its drop box. The author go the see the image.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createCourseWithParticipantFolder(@InitialPage LoginPage authorLoginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// go to authoring
AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
String title = "Course partilist " + UUID.randomUUID();
// create course
authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
String participantFolderTitle = "ParticipantList";
// open course editor
CoursePageFragment course = CoursePageFragment.getCourse(browser);
CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit().createNode("pf").nodeTitle(participantFolderTitle);
// publish
editor.publish().quickPublish(UserAccess.membersOnly);
editor.clickToolbarBack();
// add a participant
MembersPage members = new CoursePageFragment(browser).members();
members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, false, true).nextPermissions().finish();
members.clickToolbarBack();
// go to the course element
course.clickTree().selectWithTitle(participantFolderTitle);
// open the return box of the participant and upload a file
URL coachImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File coachImageFile = new File(coachImageUrl.toURI());
ParticipantFolderPage folder = new ParticipantFolderPage(browser);
folder.assertOnParticipantsList().assertOnParticipant(participant.getFirstName()).openParticipantFolder(participant.getFirstName());
FolderPage directory = folder.openReturnBox().uploadFile(coachImageFile).assertOnFile(coachImageFile.getName());
// The participant come in
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// The participant find the course
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.assertOnNavigationPage().openMyCourses().select(title);
// And opens the participant folder
CoursePageFragment participantCourse = CoursePageFragment.getCourse(participantBrowser);
participantCourse.clickTree().selectWithTitle(participantFolderTitle);
ParticipantFolderPage participantFolder = new ParticipantFolderPage(participantBrowser);
participantFolder.openReturnBox().assertOnFile(coachImageFile.getName()).selectRootDirectory();
// Participant upload a file in its drop box
URL participantImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File participantImageFile = new File(participantImageUrl.toURI());
participantFolder.openDropBox().uploadFile(participantImageFile).assertOnFile(participantImageFile.getName());
// Author check the image in the participant drop box
directory.selectRootDirectory();
folder.openDropBox().assertOnFile(participantImageFile.getName());
}
use of org.olat.selenium.page.core.FolderPage in project openolat by klemens.
the class CourseElementTest method createCourseWithParticipantFolder.
/**
* An author create a course with a participant folder course
* element. It add a participant to the course and upload file
* in the return box of this participant.<br>
* The participant come in and open the course, see the file
* uploaded by the author in its return box and it uploads an
* image in its drop box. The author go the see the image.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createCourseWithParticipantFolder(@InitialPage LoginPage authorLoginPage, @Drone @Participant WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// go to authoring
AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
String title = "Course partilist " + UUID.randomUUID();
// create course
authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateForm(title).assertOnGeneralTab().clickToolbarBack();
String participantFolderTitle = "ParticipantList";
// open course editor
CoursePageFragment course = CoursePageFragment.getCourse(browser);
CourseEditorPageFragment editor = course.assertOnCoursePage().assertOnTitle(title).openToolsMenu().edit().createNode("pf").nodeTitle(participantFolderTitle);
// publish
editor.publish().quickPublish(UserAccess.membersOnly);
editor.clickToolbarBack();
// add a participant
MembersPage members = new CoursePageFragment(browser).members();
members.addMember().searchMember(participant, true).nextUsers().nextOverview().selectRepositoryEntryRole(false, false, true).nextPermissions().finish();
members.clickToolbarBack();
// go to the course element
course.clickTree().selectWithTitle(participantFolderTitle);
// open the return box of the participant and upload a file
URL coachImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File coachImageFile = new File(coachImageUrl.toURI());
ParticipantFolderPage folder = new ParticipantFolderPage(browser);
folder.assertOnParticipantsList().assertOnParticipant(participant.getFirstName()).openParticipantFolder(participant.getFirstName());
FolderPage directory = folder.openReturnBox().uploadFile(coachImageFile).assertOnFile(coachImageFile.getName());
// The participant come in
LoginPage participantLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
participantLoginPage.loginAs(participant.getLogin(), participant.getPassword()).resume();
// The participant find the course
NavigationPage participantNavBar = new NavigationPage(participantBrowser);
participantNavBar.assertOnNavigationPage().openMyCourses().select(title);
// And opens the participant folder
CoursePageFragment participantCourse = CoursePageFragment.getCourse(participantBrowser);
participantCourse.clickTree().selectWithTitle(participantFolderTitle);
ParticipantFolderPage participantFolder = new ParticipantFolderPage(participantBrowser);
participantFolder.openReturnBox().assertOnFile(coachImageFile.getName()).selectRootDirectory();
// Participant upload a file in its drop box
URL participantImageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1484.jpg");
File participantImageFile = new File(participantImageUrl.toURI());
participantFolder.openDropBox().uploadFile(participantImageFile).assertOnFile(participantImageFile.getName());
// Author check the image in the participant drop box
directory.selectRootDirectory();
folder.openDropBox().assertOnFile(participantImageFile.getName());
}
Aggregations