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
09643c87
Commit
09643c87
authored
Mar 19, 2014
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for code format toolbar button.
parent
07d54be6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
+27
-1
cms/djangoapps/contentstore/features/html-editor.feature
+11
-0
cms/djangoapps/contentstore/features/html-editor.py
+16
-1
No files found.
cms/djangoapps/contentstore/features/html-editor.feature
View file @
09643c87
...
...
@@ -51,3 +51,14 @@ Feature: CMS.HTML Editor
And
type
"<img src="
/static/image.jpg">" in the code editor and press OK
Then
the image static link is rewritten to translate the path
And
the code editor displays
"<p><img src="
/static/image.jpg" alt="" /></p>"
Scenario
:
Code format toolbar button wraps text with code tags
Given
I have created a Blank HTML Page
When
I edit the page
And
I set the text to
"display as code"
and I select the text
And
I select the code toolbar button
And
I save the page
Then the page has text
:
"""
<p><code>display as code</code></p>
"""
cms/djangoapps/contentstore/features/html-editor.py
View file @
09643c87
...
...
@@ -95,7 +95,7 @@ def image_static_link_is_rewritten(step):
assert_in
(
'c4x/MITx/999/asset/image.jpg'
,
image
[
'src'
])
@step
(
'the expected toolbar buttons are displayed'
)
@step
(
'the expected toolbar buttons are displayed
$
'
)
def
check_toolbar_buttons
(
step
):
dropdowns
=
world
.
css_find
(
'.mce-listbox'
)
assert_equal
(
2
,
len
(
dropdowns
))
...
...
@@ -129,3 +129,18 @@ def check_toolbar_buttons(step):
check_class
(
11
,
'unlink'
)
check_class
(
12
,
'image'
)
check_class
(
13
,
'code'
)
@step
(
'I set the text to "(.*)" and I select the text$'
)
def
set_text_and_select
(
step
,
text
):
script
=
"""
var editor = tinyMCE.activeEditor;
editor.setContent(arguments[0]);
editor.selection.select(editor.dom.select('p')[0]);"""
world
.
browser
.
driver
.
execute_script
(
script
,
str
(
text
))
world
.
wait_for_ajax_complete
()
@step
(
'I select the code toolbar button$'
)
def
select_code_button
(
step
):
# This is our custom "code style" button. It uses an image instead of a class.
world
.
css_click
(
".mce-i-none"
)
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