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
f31f9360
Commit
f31f9360
authored
Mar 18, 2014
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update acceptance test for image plugin.
parent
28dc8e0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
cms/djangoapps/contentstore/features/html-editor.feature
+2
-1
cms/djangoapps/contentstore/features/html-editor.py
+10
-21
No files found.
cms/djangoapps/contentstore/features/html-editor.feature
View file @
f31f9360
...
...
@@ -22,6 +22,6 @@ Feature: CMS.HTML Editor
Scenario
:
TinyMCE image plugin sets urls correctly
Given
I have created a Blank HTML Page
When
I edit the page
and select the Visual Editor
When
I edit the page
And
I add an image with a static link via the Image Plugin Icon
Then
the image static link is rewritten to translate the path
\ No newline at end of file
cms/djangoapps/contentstore/features/html-editor.py
View file @
f31f9360
...
...
@@ -31,37 +31,26 @@ def i_created_etext_in_latex(step):
)
@step
(
'I edit the page
and select the Visual Editor
'
)
@step
(
'I edit the page
$
'
)
def
i_click_on_edit_icon
(
step
):
world
.
edit_component
()
world
.
wait_for
(
lambda
_driver
:
world
.
css_visible
(
'a.visual-tab'
))
world
.
css_click
(
'a.visual-tab'
)
@step
(
'I add an image with a static link via the Image Plugin Icon'
)
@step
(
'I add an image with a static link via the Image Plugin Icon
$
'
)
def
i_click_on_image_plugin_icon
(
step
):
# Click on image plugin button
world
.
wait_for
(
lambda
_driver
:
world
.
css_visible
(
'a.mce_image'
))
world
.
css_click
(
'a.mce_image'
)
world
.
css_click
(
'.mce-i-image'
)
# Change to the non-modal TinyMCE Image window
# keeping parent window so we can go back to it.
parent_window
=
world
.
browser
.
current_window
for
window
in
world
.
browser
.
windows
:
# Wait for the editing window to open.
world
.
wait_for_visible
(
'.mce-window'
)
world
.
browser
.
switch_to_window
(
window
)
# Switch to a different window
if
world
.
browser
.
title
==
'Insert/Edit Image'
:
# Fill in the first field (source).
world
.
css_fill
(
'.mce-textbox'
,
'/static/image.jpg'
,
0
)
# Click OK
world
.
css_click
(
'.mce-primary'
)
# This is the Image window so find the url text box,
# enter text in it then hit Insert button.
url_elem
=
world
.
browser
.
find_by_id
(
"src"
)
url_elem
.
fill
(
'/static/image.jpg'
)
world
.
browser
.
find_by_id
(
'insert'
)
.
click
()
world
.
browser
.
switch_to_window
(
parent_window
)
# Switch back to the main window
@step
(
'the image static link is rewritten to translate the path'
)
@step
(
'the image static link is rewritten to translate the path$'
)
def
image_static_link_is_rewritten
(
step
):
# Find the TinyMCE iframe within the main window
with
world
.
browser
.
get_iframe
(
'mce_0_ifr'
)
as
tinymce
:
...
...
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