Search in sources :

Example 66 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project OpenOLAT by OpenOLAT.

the class LoginTest method maintenanceMessage.

/**
 * An administrator set a maintenance message. A first user
 * logs in before and wait until the message appears. A second
 * user load the login page, check that the message is visible,
 * logs in and check that the message is visible too.
 *
 * @param loginPage
 * @param reiBrowser
 * @param kanuBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void maintenanceMessage(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    // a first user log in
    LoginPage kanuLogin = LoginPage.getLoginPage(kanuBrowser, deploymentUrl).loginAs(kanu).resume();
    // administrator come in, and set a maintenance message
    loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
    String message = "Hello - " + UUID.randomUUID();
    AdministrationMessagesPage messagesPage = new NavigationPage(browser).openAdministration().selectInfoMessages().newMaintenanceMessage(message);
    // A new user see the login page
    LoginPage.getLoginPage(reiBrowser, deploymentUrl).waitOnMaintenanceMessage(message).loginAs(rei).resume().assertOnMaintenanceMessage(message);
    kanuLogin.waitOnMaintenanceMessage(message);
    // administrator remove the message
    messagesPage.clearMaintenanceMessage();
    // we wait it disappears
    kanuLogin.waitOnMaintenanceMessageCleared();
}
Also used : UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) LoginPage(org.olat.selenium.page.LoginPage) AdministrationMessagesPage(org.olat.selenium.page.core.AdministrationMessagesPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 67 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project OpenOLAT by OpenOLAT.

the class AssessmentTest method taskWithIndividuScoreAndRevision.

/**
 * An author create a course for a task with the some custom
 * settings, all steps are selected, grading with score and
 * passed automatically calculated, 2 tasks, 1 solution...</br>
 * It had 2 participants. One of them goes through the workflow,
 * selects a task, submits 2 documents, one with the embedded editor,
 * one with the upload mechanism.</br>
 * The author reviews the documents, uploads a correction and
 * want a revision.</br>
 * The assessed participant upload a revised document.</br>
 * The author sees it and close the revisions process, use
 * the assessment tool to set the score.</br>
 * The participant checks if she successfully passed the task.
 *
 * @param authorLoginPage
 * @param ryomouBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void taskWithIndividuScoreAndRevision(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("kanu");
    UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("ryomou");
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course-with-individual-task-" + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // create a course element of type Test with the test that we create above
    String gtaNodeTitle = "Individual task 1";
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("ita").nodeTitle(gtaNodeTitle);
    GroupTaskConfigurationPage gtaConfig = new GroupTaskConfigurationPage(browser);
    gtaConfig.selectAssignment();
    URL task1Url = JunitTestHelper.class.getResource("file_resources/task_1_a.txt");
    File task1File = new File(task1Url.toURI());
    gtaConfig.uploadTask("Individual Task 1 alpha", task1File);
    URL task2Url = JunitTestHelper.class.getResource("file_resources/task_1_b.txt");
    File task2File = new File(task2Url.toURI());
    gtaConfig.uploadTask("Individual Task 2 beta", task2File).saveTasks().selectSolution();
    URL solutionUrl = JunitTestHelper.class.getResource("file_resources/solution_1.txt");
    File solutionFile = new File(solutionUrl.toURI());
    gtaConfig.uploadSolution("The Best Solution", solutionFile);
    gtaConfig.selectAssessment().setAssessmentOptions(0.0f, 6.0f, 4.0f).saveAssessmentOptions();
    courseEditor.publish().quickPublish(UserAccess.membersOnly);
    MembersPage membersPage = courseEditor.clickToolbarBack().members();
    membersPage.importMembers().setMembers(kanu, ryomou).nextUsers().nextOverview().nextPermissions().finish();
    // go to the course
    CoursePageFragment coursePage = membersPage.clickToolbarBack();
    coursePage.clickTree().selectWithTitle(gtaNodeTitle);
    // 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 group task
    CoursePageFragment ryomouTestCourse = new CoursePageFragment(ryomouBrowser);
    ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    GroupTaskPage ryomouTask = new GroupTaskPage(ryomouBrowser);
    ryomouTask.assertAssignmentAvailable().selectTask(1).assertTask("Individual Task 2 beta").assertSubmissionAvailable();
    URL submit1Url = JunitTestHelper.class.getResource("file_resources/submit_2.txt");
    File submit1File = new File(submit1Url.toURI());
    String submittedFilename = "personal_solution.html";
    String submittedText = "This is my solution";
    ryomouTask.submitFile(submit1File).submitText(submittedFilename, submittedText).submitDocuments();
    // back to author
    coursePage.clickTree().selectWithTitle(gtaNodeTitle);
    GroupTaskToCoachPage participantToCoach = new GroupTaskToCoachPage(browser);
    URL correctionUrl = JunitTestHelper.class.getResource("file_resources/correction_1.txt");
    File correctionFile = new File(correctionUrl.toURI());
    participantToCoach.selectIdentityToCoach(ryomou).assertSubmittedDocument("personal_solution.html").assertSubmittedDocument("submit_2.txt").uploadCorrection(correctionFile).needRevision();
    // participant add a revised document
    URL revisionUrl = JunitTestHelper.class.getResource("file_resources/submit_3.txt");
    File revisionFile = new File(revisionUrl.toURI());
    ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    ryomouTask.submitRevisedFile(revisionFile).submitRevision();
    // back to author
    coursePage.clickTree().selectWithTitle(gtaNodeTitle);
    participantToCoach.selectIdentityToCoach(ryomou).assertRevision("submit_3.txt").closeRevisions().openIndividualAssessment().individualAssessment(null, 5.5f).assertPassed();
    // participant checks she passed the task
    ryomouTestCourse.clickTree().selectWithTitle(gtaNodeTitle);
    ryomouTask.assertPassed();
}
Also used : CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) GroupTaskPage(org.olat.selenium.page.course.GroupTaskPage) CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) GroupTaskConfigurationPage(org.olat.selenium.page.course.GroupTaskConfigurationPage) MembersPage(org.olat.selenium.page.course.MembersPage) File(java.io.File) GroupTaskToCoachPage(org.olat.selenium.page.course.GroupTaskToCoachPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 68 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project OpenOLAT by OpenOLAT.

the class CourseElementTest method forumWithGuest.

/**
 * An administrator create a category in catalog. It creates a new course
 * with a forum open to guests. it publish the course in the
 * catalog.<br>
 * The guest find the course, create a new thread. The administrator reply
 * to the message, the guest to its reply.<br>
 * The administrator checks the last message in its new messages, click
 * back, use the list of users to see the messages of the guest. It clicks
 * back to the threads list and checks the thread has 3 messages.
 *
 * @param loginPage
 * @param guestBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void forumWithGuest(@InitialPage LoginPage loginPage, @Drone @User WebDriver guestBrowser) throws IOException, URISyntaxException {
    loginPage.loginAs("administrator", "openolat").resume();
    String node1 = "Forums " + UUID.randomUUID();
    navBar.openCatalogAdministration().addCatalogNode(node1, "First level of the catalog");
    // create a course
    String courseTitle = "Guest FO " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // go the authoring environment to create a forum
    String foTitle = "GFO - " + UUID.randomUUID();
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("fo").nodeTitle(foTitle);
    // configure for guest
    ForumCEPage forumConfig = new ForumCEPage(browser);
    forumConfig.selectConfiguration().allowGuest();
    // publish the course
    courseEditor.publish().nextSelectNodes().selectAccess(UserAccess.guest).nextAccess().selectCatalog(true).selectCategory(null, node1).nextCatalog().finish();
    // back in course
    courseEditor.clickToolbarBack();
    // guest go to the catalog and find the course
    LoginPage guestLogin = LoginPage.getLoginPage(guestBrowser, deploymentUrl);
    guestLogin.asGuest();
    NavigationPage guestNavBar = new NavigationPage(guestBrowser);
    guestNavBar.openCatalog().selectCatalogEntry(node1).select(courseTitle).start();
    // go to the forum
    new CoursePageFragment(guestBrowser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    String guestAlias = "Guest-" + UUID.randomUUID();
    ForumPage guestForum = ForumPage.getCourseForumPage(guestBrowser).createThread("Your favorite author", "Name your favorite author", guestAlias);
    // admin go to the forum
    new CoursePageFragment(browser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    // admin reply to the thread of guest
    ForumPage adminForum = ForumPage.getCourseForumPage(browser).openThread("Your favorite author").assertOnGuestPseudonym(guestAlias).newMessages().assertOnGuestPseudonym(guestAlias).replyToMessage("Your favorite author", "Huxley is my favorite author", "My favorite author is Huxley");
    // guest refresh the view and reply to admin
    guestForum.flatView().assertMessageBody("Huxley").replyToMessage("Huxley is my favorite author", " I prefer Orwell", "Orwell is my favorite author");
    // admin see its new messages, see the list of users, select the guest and its messages
    // JMS message need to be delivered
    OOGraphene.waitingALittleLonger();
    adminForum.newMessages().assertMessageBody("Orwell").clickBack().userFilter().selectFilteredUser(guestAlias).assertMessageBody("Orwell").clickBack().clickBack().assertThreadListOnNumber("Your favorite author", 3);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) ForumCEPage(org.olat.selenium.page.course.ForumCEPage) NavigationPage(org.olat.selenium.page.NavigationPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) ForumPage(org.olat.selenium.page.forum.ForumPage) LoginPage(org.olat.selenium.page.LoginPage) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 69 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project OpenOLAT by OpenOLAT.

the class CourseElementTest method forumConcurrent.

/**
 * An author creates a course with a forum, publish it, open a new thread.
 * A first user come to see the thread. A second come via the peekview.
 * The three make a reply at the same time. And they check that they see
 * the replies, and the ones of the others.
 *
 * @param loginPage
 * @param kanuBrowser
 * @param reiBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void forumConcurrent(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver kanuBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
    UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course
    String courseTitle = "Course FO " + UUID.randomUUID();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    // go the authoring environment to create a forum
    String foTitle = "FO - " + UUID.randomUUID();
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("fo").nodeTitle(foTitle).publish().quickPublish(UserAccess.registred);
    // go to the forum
    courseEditor.clickToolbarBack().clickTree().selectWithTitle(foTitle.substring(0, 20));
    ForumPage authorForum = ForumPage.getCourseForumPage(browser);
    authorForum.createThread("The best anime ever", "What is the best anime ever?", null);
    // First user go to the course
    LoginPage kanuLoginPage = LoginPage.getLoginPage(kanuBrowser, deploymentUrl);
    kanuLoginPage.loginAs(kanu.getLogin(), kanu.getPassword()).resume();
    NavigationPage kanuNavBar = new NavigationPage(kanuBrowser);
    kanuNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // go to the forum
    new CoursePageFragment(kanuBrowser).clickTree().selectWithTitle(foTitle.substring(0, 20));
    ForumPage kanuForum = ForumPage.getCourseForumPage(kanuBrowser).openThread("The best anime ever");
    // First user go to the course
    LoginPage reiLoginPage = LoginPage.getLoginPage(reiBrowser, deploymentUrl);
    reiLoginPage.loginAs(rei).resume();
    NavigationPage reiNavBar = new NavigationPage(reiBrowser);
    reiNavBar.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // select the thread in peekview
    ForumPage reiForum = new ForumPage(reiBrowser).openThreadInPeekview("The best anime ever");
    // concurrent reply
    String kanuReply = "Ikki Touzen";
    String reiReply = "Neon Genesis Evangelion";
    String authorReply = "Lain, serial experiment";
    authorForum.replyToMessageNoWait("The best anime ever", null, authorReply);
    reiForum.replyToMessageNoWait("The best anime ever", null, reiReply);
    kanuForum.replyToMessageNoWait("The best anime ever", null, kanuReply);
    // wait the responses
    OOGraphene.waitBusy(browser);
    OOGraphene.waitBusy(kanuBrowser);
    OOGraphene.waitBusy(reiBrowser);
    // check own responses
    authorForum.assertMessageBody(authorReply);
    kanuForum.assertMessageBody(kanuReply);
    reiForum.assertMessageBody(reiReply);
    // check others responses
    authorForum.flatView().waitMessageBody(kanuReply);
    reiForum.flatView().waitMessageBody(kanuReply);
    kanuForum.flatView().waitMessageBody(reiReply);
}
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) ForumPage(org.olat.selenium.page.forum.ForumPage) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 70 with NavigationPage

use of org.olat.selenium.page.NavigationPage in project OpenOLAT by OpenOLAT.

the class CourseElementTest method blogWithMultipleUsers.

/**
 * An author create a course with a blog, open it, add a post. A student
 * open the course, see the blog post. The author add a new post, the
 * student must see it.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void blogWithMultipleUsers(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver participantDrone) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    UserVO participant = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // create a course with a blog
    String courseTitle = "Course-Blog-1-" + UUID.randomUUID().toString();
    navBar.openAuthoringEnvironment().createCourse(courseTitle).clickToolbarBack();
    String blogNodeTitle = "Blog-RW-1";
    String blogTitle = "Blog - RW - " + UUID.randomUUID().toString();
    // create a course element of type blog with a blog
    CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser).edit();
    courseEditor.createNode("blog").nodeTitle(blogNodeTitle).selectTabLearnContent().createFeed(blogTitle);
    // publish the course
    courseEditor.publish().quickPublish();
    // open the course and see the blog
    CoursePageFragment course = courseEditor.clickToolbarBack();
    course.clickTree().selectWithTitle(blogNodeTitle);
    String postTitle = "Blog-RW-1-" + UUID.randomUUID();
    String postSummary = "Some explantations as teaser";
    String postContent = "Content of the post";
    FeedPage feed = FeedPage.getFeedPage(browser);
    feed.newBlog().fillPostForm(postTitle, postSummary, postContent).publishPost();
    // participant go to the blog
    participantDrone.navigate().to(deploymentUrl);
    LoginPage participantLogin = LoginPage.getLoginPage(participantDrone, deploymentUrl);
    participantLogin.loginAs(participant.getLogin(), participant.getPassword());
    // search the course in "My courses"
    NavigationPage participantNavigation = new NavigationPage(participantDrone);
    participantNavigation.openMyCourses().openSearch().extendedSearch(courseTitle).select(courseTitle).start();
    // Navigate the course to the blog
    CoursePageFragment participantCourse = new CoursePageFragment(participantDrone);
    participantCourse.clickTree().selectWithTitle(blogNodeTitle);
    FeedPage participantFeed = FeedPage.getFeedPage(participantDrone);
    participantFeed.assertOnBlogPost(postTitle);
    // the author publish a second post in its blog
    String post2Title = "Blog-RW-2-" + UUID.randomUUID();
    String post2Summary = "Some explantations as teaser";
    String post2Content = "Content of the post";
    feed.addBlogPost().fillPostForm(post2Title, post2Summary, post2Content).publishPost();
    // the participant must see the new post after some click
    participantFeed.clickFirstMonthOfPager().assertOnBlogPost(post2Title);
}
Also used : CourseEditorPageFragment(org.olat.selenium.page.course.CourseEditorPageFragment) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) FeedPage(org.olat.selenium.page.repository.FeedPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) LoginPage(org.olat.selenium.page.LoginPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)112 Test (org.junit.Test)112 NavigationPage (org.olat.selenium.page.NavigationPage)112 UserRestClient (org.olat.test.rest.UserRestClient)110 UserVO (org.olat.user.restapi.UserVO)110 LoginPage (org.olat.selenium.page.LoginPage)100 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)56 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)44 QTI21Page (org.olat.selenium.page.qti.QTI21Page)40 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)38 URL (java.net.URL)30 File (java.io.File)28 MembersPage (org.olat.selenium.page.course.MembersPage)28 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)20 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)18 GroupPage (org.olat.selenium.page.group.GroupPage)16 QTI21MatchEditorPage (org.olat.selenium.page.qti.QTI21MatchEditorPage)10 Calendar (java.util.Calendar)8 AssessmentToolPage (org.olat.selenium.page.course.AssessmentToolPage)8 EnrollmentConfigurationPage (org.olat.selenium.page.course.EnrollmentConfigurationPage)8