Skip to content
Snippets Groups Projects
Commit 9c0567f2 authored by srosse's avatar srosse
Browse files

OO-1839: add a selenium test

parent 788e8fd5
No related branches found
No related tags found
No related merge requests found
...@@ -164,6 +164,53 @@ public class CourseTest { ...@@ -164,6 +164,53 @@ public class CourseTest {
.clickTree(); .clickTree();
} }
/**
* Check if we can create and open a course with this
* name: It's me, the "course".
* @see https://jira.openolat.org/browse/OO-1839
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void createCourseWithSpecialCharacters(@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 marker = Long.toString(System.currentTimeMillis());
String title = "It's me, the \"course\" number " + marker;
//create course
RepositoryEditDescriptionPage editDescription = authoringEnv
.openCreateDropDown()
.clickCreate(ResourceType.course)
.fillCreateForm(title)
.assertOnGeneralTab();
//from description editor, back to the course
editDescription
.clickToolbarBack();
//close the course
navBar.closeTab();
//select the authoring
navBar
.openAuthoringEnvironment()
.selectResource(marker);
new CoursePageFragment(browser)
.assertOnCoursePage();
}
/** /**
* Create a course, use the course wizard, select all course * Create a course, use the course wizard, select all course
* elements and go further with the standard settings. * elements and go further with the standard settings.
......
...@@ -176,4 +176,11 @@ public class NavigationPage { ...@@ -176,4 +176,11 @@ public class NavigationPage {
OOGraphene.closeBlueMessageWindow(browser); OOGraphene.closeBlueMessageWindow(browser);
return this; return this;
} }
public NavigationPage closeTab() {
By closeBy = By.xpath("//li//a[contains(@class,'o_navbar_tab_close')]");
browser.findElement(closeBy).click();
return this;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment