Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
71a048a6
Commit
71a048a6
authored
Aug 11, 2016
by
Brian Jacobel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bok choy tests for discussions editor preview pane
parent
d347492c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
common/test/acceptance/pages/lms/discussion.py
+14
-0
common/test/acceptance/tests/discussion/test_discussion.py
+34
-0
No files found.
common/test/acceptance/pages/lms/discussion.py
View file @
71a048a6
...
@@ -723,3 +723,17 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
...
@@ -723,3 +723,17 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
"""
"""
elements
=
self
.
q
(
css
=
".forum-new-post-form"
)
elements
=
self
.
q
(
css
=
".forum-new-post-form"
)
return
elements
[
0
]
if
elements
.
visible
and
len
(
elements
)
==
1
else
None
return
elements
[
0
]
if
elements
.
visible
and
len
(
elements
)
==
1
else
None
def
set_new_post_editor_value
(
self
,
new_body
):
"""
Set the Discussions new post editor (wmd) with the content in new_body
"""
self
.
q
(
css
=
".wmd-input"
)
.
fill
(
new_body
)
def
get_new_post_preview_value
(
self
):
"""
Get the rendered preview of the contents of the Discussions new post editor
Waits for content to appear, as the preview is triggered on debounced/delayed onchange
"""
self
.
wait_for_element_visibility
(
".wmd-preview > *"
,
"WMD preview pane has contents"
,
timeout
=
10
)
return
self
.
q
(
css
=
".wmd-preview"
)
.
html
[
0
]
common/test/acceptance/tests/discussion/test_discussion.py
View file @
71a048a6
...
@@ -838,6 +838,40 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase):
...
@@ -838,6 +838,40 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase):
@attr
(
shard
=
2
)
@attr
(
shard
=
2
)
class
DiscussionEditorPreviewTest
(
UniqueCourseTest
):
def
setUp
(
self
):
super
(
DiscussionEditorPreviewTest
,
self
)
.
setUp
()
CourseFixture
(
**
self
.
course_info
)
.
install
()
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
)
.
visit
()
self
.
page
=
DiscussionTabHomePage
(
self
.
browser
,
self
.
course_id
)
self
.
page
.
visit
()
self
.
page
.
click_new_post_button
()
def
test_text_rendering
(
self
):
"""When I type plain text into the editor, it should be rendered as plain text in the preview box"""
self
.
page
.
set_new_post_editor_value
(
"Some plain text"
)
self
.
assertEqual
(
self
.
page
.
get_new_post_preview_value
(),
"<p>Some plain text</p>"
)
def
test_markdown_rendering
(
self
):
"""When I type Markdown into the editor, it should be rendered as formatted Markdown in the preview box"""
self
.
page
.
set_new_post_editor_value
(
"Some markdown
\n
"
"
\n
"
"- line 1
\n
"
"- line 2"
)
self
.
assertEqual
(
self
.
page
.
get_new_post_preview_value
(),
(
"<p>Some markdown</p>
\n
"
"
\n
"
"<ul>
\n
"
"<li>line 1</li>
\n
"
"<li>line 2</li>
\n
"
"</ul>"
))
@attr
(
shard
=
2
)
class
InlineDiscussionTest
(
UniqueCourseTest
,
DiscussionResponsePaginationTestMixin
):
class
InlineDiscussionTest
(
UniqueCourseTest
,
DiscussionResponsePaginationTestMixin
):
"""
"""
Tests for inline discussions
Tests for inline discussions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment