Search in sources :

Example 1 with CourseWizardPage

use of org.olat.selenium.page.course.CourseWizardPage in project OpenOLAT by OpenOLAT.

the class CourseTest method createCourse_withWizard.

/**
 * Create a course, use the course wizard, select all course
 * elements and go further with the standard settings.
 *
 * Go from the description editor to the course, check
 * that the course is automatically published and that
 * the five course elements are there.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse_withWizard(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Course-Wizard-" + UUID.randomUUID().toString();
    // create course
    CourseWizardPage courseWizard = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateFormAndStartWizard(title);
    courseWizard.selectAllCourseElements().nextNodes().nextCatalog().finish();
    // OOGraphene.closeErrorBox(browser);//STMP error
    RepositoryEditDescriptionPage editDescription = new RepositoryEditDescriptionPage(browser);
    // from description editor, back to details and launch the course
    editDescription.assertOnGeneralTab();
    // close mail error
    OOGraphene.closeErrorBox(browser);
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    course.assertOnCoursePage().assertOnTitle(title);
    // assert the 5 nodes are there and click them
    By nodeBy = By.cssSelector("span.o_tree_link.o_tree_l1.o_tree_level_label_leaf>a");
    List<WebElement> nodes = browser.findElements(nodeBy);
    Assert.assertEquals(5, nodes.size());
    for (WebElement node : nodes) {
        node.click();
        OOGraphene.waitBusy(browser);
    }
}
Also used : UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) CourseWizardPage(org.olat.selenium.page.course.CourseWizardPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) By(org.openqa.selenium.By) WebElement(org.openqa.selenium.WebElement) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 2 with CourseWizardPage

use of org.olat.selenium.page.course.CourseWizardPage in project OpenOLAT by OpenOLAT.

the class AuthoringEnvPage method fillCreateFormAndStartWizard.

/**
 * Fill the create form and start the wizard
 * @param displayName
 * @return
 */
public CourseWizardPage fillCreateFormAndStartWizard(String displayName) {
    OOGraphene.waitModalDialog(browser);
    By inputBy = By.cssSelector("div.modal.o_sel_author_create_popup div.o_sel_author_displayname input");
    browser.findElement(inputBy).sendKeys(displayName);
    By createBy = By.cssSelector("div.modal.o_sel_author_create_popup .o_sel_author_create_wizard");
    browser.findElement(createBy).click();
    OOGraphene.waitBusy(browser);
    return new CourseWizardPage(browser);
}
Also used : CourseWizardPage(org.olat.selenium.page.course.CourseWizardPage) By(org.openqa.selenium.By)

Example 3 with CourseWizardPage

use of org.olat.selenium.page.course.CourseWizardPage in project openolat by klemens.

the class AuthoringEnvPage method fillCreateFormAndStartWizard.

/**
 * Fill the create form and start the wizard
 * @param displayName
 * @return
 */
public CourseWizardPage fillCreateFormAndStartWizard(String displayName) {
    OOGraphene.waitModalDialog(browser);
    By inputBy = By.cssSelector("div.modal.o_sel_author_create_popup div.o_sel_author_displayname input");
    browser.findElement(inputBy).sendKeys(displayName);
    By createBy = By.cssSelector("div.modal.o_sel_author_create_popup .o_sel_author_create_wizard");
    browser.findElement(createBy).click();
    OOGraphene.waitBusy(browser);
    return new CourseWizardPage(browser);
}
Also used : CourseWizardPage(org.olat.selenium.page.course.CourseWizardPage) By(org.openqa.selenium.By)

Example 4 with CourseWizardPage

use of org.olat.selenium.page.course.CourseWizardPage in project openolat by klemens.

the class CourseTest method createCourse_withWizard.

/**
 * Create a course, use the course wizard, select all course
 * elements and go further with the standard settings.
 *
 * Go from the description editor to the course, check
 * that the course is automatically published and that
 * the five course elements are there.
 *
 * @param loginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void createCourse_withWizard(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    loginPage.loginAs(author.getLogin(), author.getPassword());
    // go to authoring
    AuthoringEnvPage authoringEnv = navBar.assertOnNavigationPage().openAuthoringEnvironment();
    String title = "Create-Course-Wizard-" + UUID.randomUUID().toString();
    // create course
    CourseWizardPage courseWizard = authoringEnv.openCreateDropDown().clickCreate(ResourceType.course).fillCreateFormAndStartWizard(title);
    courseWizard.selectAllCourseElements().nextNodes().nextCatalog().finish();
    // OOGraphene.closeErrorBox(browser);//STMP error
    RepositoryEditDescriptionPage editDescription = new RepositoryEditDescriptionPage(browser);
    // from description editor, back to details and launch the course
    editDescription.assertOnGeneralTab();
    // close mail error
    OOGraphene.closeErrorBox(browser);
    editDescription.clickToolbarBack();
    // open course editor
    CoursePageFragment course = CoursePageFragment.getCourse(browser);
    course.assertOnCoursePage().assertOnTitle(title);
    // assert the 5 nodes are there and click them
    By nodeBy = By.cssSelector("span.o_tree_link.o_tree_l1.o_tree_level_label_leaf>a");
    List<WebElement> nodes = browser.findElements(nodeBy);
    Assert.assertEquals(5, nodes.size());
    for (WebElement node : nodes) {
        node.click();
        OOGraphene.waitBusy(browser);
    }
}
Also used : UserVO(org.olat.user.restapi.UserVO) AuthoringEnvPage(org.olat.selenium.page.repository.AuthoringEnvPage) CourseWizardPage(org.olat.selenium.page.course.CourseWizardPage) CoursePageFragment(org.olat.selenium.page.course.CoursePageFragment) By(org.openqa.selenium.By) WebElement(org.openqa.selenium.WebElement) RepositoryEditDescriptionPage(org.olat.selenium.page.repository.RepositoryEditDescriptionPage) UserRestClient(org.olat.test.rest.UserRestClient) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

CourseWizardPage (org.olat.selenium.page.course.CourseWizardPage)4 By (org.openqa.selenium.By)4 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)2 Test (org.junit.Test)2 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)2 AuthoringEnvPage (org.olat.selenium.page.repository.AuthoringEnvPage)2 RepositoryEditDescriptionPage (org.olat.selenium.page.repository.RepositoryEditDescriptionPage)2 UserRestClient (org.olat.test.rest.UserRestClient)2 UserVO (org.olat.user.restapi.UserVO)2 WebElement (org.openqa.selenium.WebElement)2