Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
b0a7443
updated pdf viewer
Mar 17, 2014
d5bb1b5
Add some optional policies around password resets, such as password r…
Mar 3, 2014
ff8a0c6
password history: just limit the result set range to simplify iterati…
Mar 25, 2014
e2de072
Fix flaky acceptance test.
auraz Apr 1, 2014
19e9ff7
Fixed studio can't handle more than 9 lines in advanced settings.
waheedahmed Apr 1, 2014
d0daa61
Remove unused function
cpennington Mar 26, 2014
6c06b39
Centralize when json parsing of responses from controller_query_servi…
cpennington Mar 26, 2014
f1999d8
Fixed nested bullets to enable PDF
mhoeber Apr 1, 2014
3b14ee8
Fix a decode error in course_about.html and make some string translat…
louyihua Apr 1, 2014
2a1ddab
Improve inline discussion UI
Mar 28, 2014
1cd932c
Fixes LMS-2474 by ensuring that readElts reads always reads an element
Mar 31, 2014
9bcbba6
Emit datadog events for all course enrollments, not just those outsid…
cpennington Apr 1, 2014
153fd49
Merge pull request #3110 from edx/gprice/inline-visual-fixup
Apr 1, 2014
66ecbc9
Merge pull request #3134 from edx/dcs/a11y-gentle-alert
Apr 1, 2014
cee1ebc
Merge pull request #3157 from edx/markhoeber/documentation/PDF-fix
mhoeber Apr 1, 2014
fe7e420
Collect metrics around the open_ended_grading controller_query_service
cpennington Mar 26, 2014
bdee9a9
Correctly catch RubricParsingErrors
cpennington Mar 26, 2014
6430e7e
Make GradingServices always return dictionaries, rather than sometime…
cpennington Mar 27, 2014
f2b554d
Record metrics about the peer grading service
cpennington Mar 27, 2014
c9a5e9b
Record metrics about the staff grading service
cpennington Mar 27, 2014
0513e14
Actually push json parsing all the way down to the bottom of the Grad…
cpennington Mar 28, 2014
2689967
Merge pull request #3158 from cpennington/enrollment-metrics
cpennington Apr 1, 2014
4b1228b
Merge pull request #3119 from louyihua/translation-fix
sarina Apr 1, 2014
1bd0bcb
Merge pull request #3091 from cpennington/ora-metrics
cpennington Apr 1, 2014
630a0b0
Capture metrics for problem attempts and histograms of problem grades
cpennington Apr 1, 2014
80e1270
Make new-style chinese language codes works for translation
louyihua Apr 2, 2014
90437fa
Display transcript translations for student in their source language.
auraz Mar 27, 2014
6199c85
Fix acceptance tests.
auraz Apr 2, 2014
d194d0e
Wait for big subtitles to render.
auraz Apr 2, 2014
bae6052
Set big timeout for big subtitles.
auraz Apr 2, 2014
bb9f720
unicode fixes
devdob Apr 2, 2014
35be2e3
line fix
devdob Apr 2, 2014
f5c9198
Merge pull request #3162 from cpennington/problem-check-metrics
cpennington Apr 2, 2014
d44b117
Merge pull request #3148 from louyihua/localization-fix
singingwolfboy Apr 2, 2014
05ef8d8
Instructor- and student-facing documentation for ORA2
srpearce Mar 24, 2014
d283eac
Merge pull request #3044 from edx/sylviapearce/documentation/DOC-191
srpearce Apr 2, 2014
c822abc
Grading Documentation Update
mhoeber Mar 31, 2014
186e3b8
Temporarily disable studio acid block tests that are failing
Apr 2, 2014
1851c05
Merge pull request #3174 from edx/zoldak/disable-acid
Apr 2, 2014
fe84772
Upgrade to TinyMCE 4.0.16.
devdob Feb 13, 2014
a8b77b9
Merge pull request #3171 from abdoosh00/unicode-fixes
singingwolfboy Apr 2, 2014
1cb7628
Don't hardcode https protocol in password reset email.
mtyaka Apr 1, 2014
b7dc8d1
Merge pull request #3137 from edx/markhoeber/documentation/doc-97
mhoeber Apr 2, 2014
9c1a42b
Use postMessage to communicate between the iframe and TinyMCE.
Mar 27, 2014
f44a1b6
Tiny MCE version 4.0.20
nasthagiri Mar 28, 2014
786b416
removing tinymce button border only on active to counteract fun LMS b…
Mar 31, 2014
aaf842f
Add dialog plugin code to compressed JS file and CSS file.
Mar 31, 2014
9d9b2b8
Directions for creating codemirror-compressed.js
Mar 31, 2014
6443486
scoping TinyMCE editing CSS to just tinyMCE context-based elements
talbs Apr 1, 2014
cc15a26
revising default (minified) TinyMCE content CSS to be scoped to .mce-…
talbs Apr 1, 2014
b04a0d9
Update default font size to 14 for bulk e-mail editor (LMS).
Apr 1, 2014
473ed4c
Studio: syncing up font-based styling between TinyMCE editing view an…
talbs Apr 1, 2014
e4de5d2
Match our default code editor font size of 13.
Apr 1, 2014
7d38c49
Fixes potential 'too many open files error' when running all servers.
Apr 2, 2014
beb1d74
Paver should install requirements/private.txt
Apr 2, 2014
7e23e26
Rename metrics so that we capture checks as well as scores and number…
cpennington Apr 2, 2014
638da49
Remove a method call which depends on IPython.
Apr 2, 2014
092d620
Merge pull request #3147 from mtyaka/password-reset-email-http
singingwolfboy Apr 2, 2014
e79cc79
Initial draft and images for LMS-2381
Mar 25, 2014
42a1f6e
Merge pull request #3116 from edx/ahodges/documentation/launching
mhoeber Apr 2, 2014
cc275a9
Check iframe src for the specific value TinyMCE uses.
Apr 2, 2014
86cfda3
Add synchronization for rendering to studio xblock tests
Apr 2, 2014
269cd19
Merge pull request #3155 from edx/christina/tinymce-update-cdn2
Apr 2, 2014
4874c45
remove double icons in the wiki sidebar
Apr 2, 2014
e81c12c
switching more wiki icons to use the right format
Apr 2, 2014
af48642
Merge pull request #3179 from cpennington/problem-check-metrics
cpennington Apr 2, 2014
7b2cbfc
make beta dash compute module_state_key like legacy dash (LMS-2491)
adampalay Apr 2, 2014
aefa456
add failing tests
adampalay Apr 2, 2014
cb5e3c8
Upgrade pyparsing to 2.0.1
singingwolfboy Apr 2, 2014
65a9ce2
Merge pull request #3170 from edx/valera/remove_ipython_dependent_met…
valera-rozuvan Apr 2, 2014
bda1471
Merge pull request #3178 from edx/ned/private-requirements-in-paver
nedbat Apr 2, 2014
69ed998
Reorganizatio of Setting up Course
mhoeber Apr 1, 2014
f275f54
Merge pull request #3165 from edx/markhoeber/documentation/doc-188
mhoeber Apr 2, 2014
732bf3f
Fix hash_resource to avoid encode errors.
Apr 3, 2014
11d078a
Merge pull request #3192 from edx/ned/fix-encode-error-when-hashing-r…
nedbat Apr 3, 2014
80635a9
Merge pull request #3149 from edx/alex/fix_flaky_test
auraz Apr 3, 2014
2a39d28
Fix flaky test #12
auraz Apr 2, 2014
c3f9943
Fix lms video #20: scroll view to be clickable.
auraz Apr 3, 2014
e3902cb
Merge pull request #3198 from edx/alex/fix_flaky_video_test_12
auraz Apr 3, 2014
fab43e1
Merge pull request #3199 from edx/alex/fix_flaky_video_test_20
auraz Apr 3, 2014
221f4e2
Fix flaky video test #21: increase timeout.
auraz Apr 3, 2014
cf3e2c8
Fix flaky video tests: speed up youtube api loading and wait for cont…
auraz Apr 1, 2014
41695de
Merge pull request #3136 from edx/alex/display_native_language_2
auraz Apr 3, 2014
668134d
Merge pull request #3169 from edx/alex/fix_more_flaky_tests
auraz Apr 3, 2014
2f572a8
Refactor video caption module.
polesye Mar 31, 2014
70db47a
Merge pull request #3201 from edx/alex/fix_971
auraz Apr 3, 2014
b085994
Merge pull request #3181 from edx/zoldak/fix-acid
Apr 3, 2014
0a8d07c
Documentation for Pages and Wiki changes
mhoeber Mar 26, 2014
4be9c06
Merge pull request #3078 from edx/markhoeber/documentation/stud-1443
mhoeber Apr 3, 2014
0489628
Merge pull request #3150 from edx/waheed/stud1483-cannot-handle-more-…
zubair-arbi Apr 3, 2014
6dc4640
Release notes for 4/2/14
mhoeber Apr 2, 2014
c202e2a
Merge pull request #3177 from edx/dcs/paver-one-watcher
Apr 3, 2014
d6a0d6f
Merge pull request #3180 from edx/christina/iframe_binding_bug
Apr 3, 2014
1763922
Upgrade django_nose to 1.2
singingwolfboy Apr 3, 2014
9e00d6f
Merge pull request #3172 from edx/markhoeber/documentation/doc-248
mhoeber Apr 3, 2014
751bd71
Merge remote-tracking branch 'origin/release'
Apr 3, 2014
12c2e1b
Test TemplateLookup dirs are not cleared during lms startup.
symbolist Apr 2, 2014
394e9ef
make sure new lms/tests.py file is run
adampalay Apr 2, 2014
63c58bb
Merge pull request #3189 from edx/db/upgrade-pyparsing
singingwolfboy Apr 3, 2014
3d7915f
Use monospaced font for CodeMirror editor.
Apr 1, 2014
aa41635
XModule datadog metrics
Apr 1, 2014
dfed60f
Merge pull request #3163 from edx/christina/advanced-settings-font
Apr 3, 2014
dd7bae4
Merge pull request #3164 from edx/flowerhack/better-xmodule-metrics
flowerhack Apr 3, 2014
011a2fc
This should enable logging of codejail on prod
Apr 3, 2014
ec6388b
Merge pull request #3153 from edx/anton/caption_refactor
polesye Apr 4, 2014
b3075e2
Merge pull request #3205 from edx/usman/lms2498-mako-template-tests
symbolist Apr 4, 2014
da470af
Merge pull request #3187 from edx/adam/fix-alter-xblock-student-state
symbolist Apr 4, 2014
d555547
BLD-958: Force video player in flash mode.
polesye Apr 3, 2014
40d5f1e
Merge pull request #3195 from edx/anton/force-flash
polesye Apr 4, 2014
6292e55
Merge pull request #3204 from edx/db/upgrade-django-nose
singingwolfboy Apr 4, 2014
72259b2
Fix the pointer to the contentstore in the bok-choy settings
Apr 4, 2014
3456c11
Added "Edit in CMS" links throughout courseware
caesar2164 Feb 7, 2014
562875e
Merge pull request #3184 from edx/frances/fix/lms-wiki-icons
Apr 4, 2014
d2bac9b
Merge pull request #2552 from edx/giulio/edit-in-cms-links
caesar2164 Apr 4, 2014
5f95d2a
Stray space made html file formatting incorrect
Apr 4, 2014
c407e89
Merge pull request #2781 from edx/cdodge/password-history-enforcements
Apr 4, 2014
e1887d8
Merge pull request #3223 from edx/ahodges/documentation/spacing
Apr 4, 2014
b02d609
Updates to ORA2 documentation
srpearce Apr 4, 2014
1580ee6
AN-836: draft info about spreadsheets and UTF8, illustrations
Apr 4, 2014
f75561a
Merge pull request #3221 from edx/ahodges/documentation/excel
Apr 4, 2014
2f16bbe
Merge pull request #3226 from edx/sylvia/documentation/DOC-269
srpearce Apr 4, 2014
aade444
Move overview drag and drop code to a utility class.
Apr 3, 2014
d45cd90
Merge pull request #3218 from edx/zoldak/bok-choy-contentstore
Apr 6, 2014
c73ac2a
Merge pull request #3208 from edx/christina/container-reorder
Apr 6, 2014
c0b50c7
Change user.is_authenticated to user.is_authenticated() in roles.py.
waheedahmed Mar 26, 2014
059c5ce
Merge pull request #3065 from edx/waheed/lms2442-fix-is_authenticated…
waheedahmed Apr 7, 2014
6c43f27
Updating the ORA2 hash for release week 2014-04-07
Apr 7, 2014
6a20771
BLD-970: Fix flaky test.
polesye Apr 4, 2014
ad186e2
Merge pull request #2986 from edx/dcs/a11y-pdfreader
Apr 7, 2014
1b28b6a
Merge pull request #3215 from edx/anton/fix-test-video-position
polesye Apr 7, 2014
862828d
Merge pull request #3233 from edx/sanchez/update-ora2
Apr 7, 2014
af17ae9
Updating the release with a tagged hash
Apr 7, 2014
707ee5f
Change behavior of cohort addition interface
Apr 4, 2014
a779686
Merge pull request #3228 from edx/gprice/FOR-542
Apr 7, 2014
d7f499f
Don't pull unreviewed languages from Transifex
sarina Apr 3, 2014
42728d6
Update translations (autogenerated message)
sarina Apr 7, 2014
64dd8d8
Merge pull request #3236 from edx/sanchez/ora2-2014-04-07
Apr 7, 2014
25f722d
Merge pull request #3212 from edx/dcs/log-codejail
Apr 7, 2014
c51d418
Merge pull request #3235 from edx/sarina/040714-language-update
sarina Apr 7, 2014
3f0a405
Updating ORA2 requirements for patch fix
Apr 8, 2014
f617047
Explicitly declare `tags` in dog stats increment calls
sarina Apr 8, 2014
e008de8
Fix source editor for the case of no CodeMirror editor.
Apr 8, 2014
ef3a2b8
Use the correct response when using login.
dianakhuang Apr 8, 2014
d296eea
Merge pull request #3253 from edx/sarina/fix-capa-calls
sarina Apr 8, 2014
550f9d7
Merge pull request #3244 from edx/christina/latex-bug-release
Apr 8, 2014
9c0ec68
Merge pull request #3256 from edx/diana/fix-grading-service-login
dianakhuang Apr 8, 2014
a904fa0
Revert "updated pdf viewer"
Apr 8, 2014
d71aa87
Revert refund instruction message
Apr 8, 2014
745924b
Merge pull request #3265 from edx/flowerhack/refund-message-patch
flowerhack Apr 8, 2014
9067ebe
Fixed import of "dog_stats_api" in staff_grading_service.py.
waheedahmed Apr 9, 2014
718bca6
Merge pull request #3279 from edx/waheed/lms2521-staff-grading-panel-…
Apr 9, 2014
7cb052e
Upgrade JSDraw.
Apr 9, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.

Blades: Transcript translations should be displayed in their source language (BLD-935).

Blades: Create an upload modal for video transcript translations (BLD-751).

Studio and LMS: Upgrade version of TinyMCE to 4.0.20. Switch from tabbed Visual/HTML
Editor for HTML modules to showing the code editor as a plugin within TinyMCE (triggered
from toolbar). STUD-1422

Studio: Add ability to reorder Pages and hide the Wiki page. STUD-1375

Blades: Added template for iFrames. BLD-611.
Expand Down
18 changes: 11 additions & 7 deletions cms/djangoapps/contentstore/features/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,23 @@ def i_am_shown_a_notification(step):
assert world.is_css_present('.wrapper-prompt')


def type_in_codemirror(index, text):
def type_in_codemirror(index, text, find_prefix="$"):
script = """
var cm = $('div.CodeMirror:eq({})').get(0).CodeMirror;
var cm = {find_prefix}('div.CodeMirror:eq({index})').get(0).CodeMirror;
cm.getInputField().focus();
cm.setValue(arguments[0]);
cm.getInputField().blur();""".format(index)
cm.getInputField().blur();""".format(index=index, find_prefix=find_prefix)
world.browser.driver.execute_script(script, str(text))
world.wait_for_ajax_complete()

def get_codemirror_value(index=0):
return world.browser.driver.execute_script("""
return $('div.CodeMirror:eq({})').get(0).CodeMirror.getValue();
""".format(index))

def get_codemirror_value(index=0, find_prefix="$"):
return world.browser.driver.execute_script(
"""
return {find_prefix}('div.CodeMirror:eq({index})').get(0).CodeMirror.getValue();
""".format(index=index, find_prefix=find_prefix)
)



def attach_file(filename, sub_path):
Expand Down
50 changes: 47 additions & 3 deletions cms/djangoapps/contentstore/features/html-editor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,50 @@ 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
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
When I edit the page
And I add an image with static link "/static/image.jpg" via the Image Plugin Icon
Then the src link is rewritten to "c4x/MITx/999/asset/image.jpg"
And the link is shown as "/static/image.jpg" in the Image Plugin

Scenario: TinyMCE link plugin sets urls correctly
Given I have created a Blank HTML Page
When I edit the page
And I add a link with static link "/static/image.jpg" via the Link Plugin Icon
Then the href link is rewritten to "c4x/MITx/999/asset/image.jpg"
And the link is shown as "/static/image.jpg" in the Link Plugin

Scenario: TinyMCE and CodeMirror preserve style tags
Given I have created a Blank HTML Page
When I edit the page
And type "<p class='title'>pages</p><style><!-- .title { color: red; } --></style>" in the code editor and press OK
And I save the page
Then the page text contains:
"""
<p class="title">pages</p>
<style><!--
.title { color: red; }
--></style>
"""

Scenario: TinyMCE toolbar buttons are as expected
Given I have created a Blank HTML Page
When I edit the page
Then the expected toolbar buttons are displayed

Scenario: Static links are converted when switching between code editor and WYSIWYG views
Given I have created a Blank HTML Page
When I edit the page
And type "<img src="/static/image.jpg">" in the code editor and press OK
Then the src link is rewritten to "c4x/MITx/999/asset/image.jpg"
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 text contains:
"""
<p><code>display as code</code></p>
"""
180 changes: 155 additions & 25 deletions cms/djangoapps/contentstore/features/html-editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# pylint: disable=C0111

from lettuce import world, step
from nose.tools import assert_in # pylint: disable=no-name-in-module
from nose.tools import assert_in, assert_equal # pylint: disable=no-name-in-module
from common import type_in_codemirror, get_codemirror_value

CODEMIRROR_SELECTOR_PREFIX = "$('iframe').contents().find"


@step('I have created a Blank HTML Page$')
Expand Down Expand Up @@ -31,41 +34,168 @@ 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')
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')
@step('I add an image with static link "(.*)" via the Image Plugin Icon$')
def i_click_on_image_plugin_icon(step, path):
use_plugin(
'.mce-i-image',
lambda: world.css_fill('.mce-textbox', path, 0)
)


@step('the link is shown as "(.*)" in the Image Plugin$')
def check_link_in_image_plugin(step, path):
use_plugin(
'.mce-i-image',
lambda: assert_equal(path, world.css_find('.mce-textbox')[0].value)
)


@step('I add a link with static link "(.*)" via the Link Plugin Icon$')
def i_click_on_link_plugin_icon(step, path):
def fill_in_link_fields():
world.css_fill('.mce-textbox', path, 0)
world.css_fill('.mce-textbox', 'picture', 1)

use_plugin('.mce-i-link', fill_in_link_fields)

# 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:

world.browser.switch_to_window(window) # Switch to a different window
if world.browser.title == 'Insert/Edit Image':
@step('the link is shown as "(.*)" in the Link Plugin$')
def check_link_in_link_plugin(step, path):
# Ensure caret position is within the link just created.
script = """
var editor = tinyMCE.activeEditor;
editor.selection.select(editor.dom.select('a')[0]);"""
world.browser.driver.execute_script(script)
world.wait_for_ajax_complete()

use_plugin(
'.mce-i-link',
lambda: assert_equal(path, world.css_find('.mce-textbox')[0].value)
)


@step('type "(.*)" in the code editor and press OK$')
def type_in_codemirror_plugin(step, text):
use_code_editor(
lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX)
)


@step('and the code editor displays "(.*)"$')
def verify_code_editor_text(step, text):
use_code_editor(
lambda: assert_equal(text, get_codemirror_value(0, CODEMIRROR_SELECTOR_PREFIX))
)

# 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
def use_plugin(button_class, action):
# Click on plugin button
world.css_click(button_class)
perform_action_in_plugin(action)


@step('the image static link is rewritten to translate the path')
def image_static_link_is_rewritten(step):
def use_code_editor(action):
# Click on plugin button
buttons = world.css_find('div.mce-widget>button')

code_editor = [button for button in buttons if button.text == 'HTML']
assert_equal(1, len(code_editor))
code_editor[0].click()

perform_action_in_plugin(action)


def perform_action_in_plugin(action):
# Wait for the plugin window to open.
world.wait_for_visible('.mce-window')

# Trigger the action
action()

# Click OK
world.css_click('.mce-primary')


@step('I save the page$')
def i_click_on_save(step):
world.save_component(step)


@step('the page text contains:')
def check_page_text(step):
assert_in(step.multiline, world.css_find('.xmodule_HtmlModule').html)


@step('the src link is rewritten to "(.*)"$')
def image_static_link_is_rewritten(step, path):
# Find the TinyMCE iframe within the main window
with world.browser.get_iframe('mce_0_ifr') as tinymce:
image = tinymce.find_by_tag('img').first
assert_in(path, image['src'])

# Test onExecCommandHandler set the url to absolute.
assert_in('c4x/MITx/999/asset/image.jpg', image['src'])

@step('the href link is rewritten to "(.*)"$')
def link_static_link_is_rewritten(step, path):
# Find the TinyMCE iframe within the main window
with world.browser.get_iframe('mce_0_ifr') as tinymce:
link = tinymce.find_by_tag('a').first
assert_in(path, link['href'])


@step('the expected toolbar buttons are displayed$')
def check_toolbar_buttons(step):
dropdowns = world.css_find('.mce-listbox')
assert_equal(2, len(dropdowns))

# Format dropdown
assert_equal('Paragraph', dropdowns[0].text)
# Font dropdown
assert_equal('Font Family', dropdowns[1].text)

buttons = world.css_find('.mce-ico')

# Note that the code editor icon is not present because we are now showing text instead of an icon.
# However, other test points user the code editor, so we have already verified its presence.
expected_buttons = [
'bold',
'italic',
'underline',
'forecolor',
# This is our custom "code style" button, which uses an image instead of a class.
'none',
'bullist',
'numlist',
'outdent',
'indent',
'blockquote',
'link',
'unlink',
'image'
]

assert_equal(len(expected_buttons), len(buttons))

for index, button in enumerate(expected_buttons):
class_names = buttons[index]._element.get_attribute('class')
assert_equal("mce-ico mce-i-" + button, class_names)


@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")
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/features/transcripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def upload_file(_step, file_name):

@step('I see "([^"]*)" text in the captions')
def check_text_in_the_captions(_step, text):
world.wait_for(lambda _: world.css_text('.subtitles'))
world.wait_for_present('.video.is-captions-rendered')
world.wait_for(lambda _: world.css_text('.subtitles'), timeout=30)
actual_text = world.css_text('.subtitles')
assert (text in actual_text)

Expand Down
3 changes: 1 addition & 2 deletions cms/djangoapps/contentstore/features/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def go_to_uploads(_step):

@step(u'I upload the( test)? file "([^"]*)"$')
def upload_file(_step, is_test_file, file_name):
upload_css = 'a.upload-button'
world.css_click(upload_css)
world.click_link('Upload New File')

if not is_test_file:
_write_test_file(file_name, "test file")
Expand Down
7 changes: 6 additions & 1 deletion cms/djangoapps/contentstore/features/video-editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
from common import upload_file, attach_file

TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
LANGUAGES = {l[0]: l[1] for l in settings.ALL_LANGUAGES}

NATIVE_LANGUAGES = {lang: label for lang, label in settings.LANGUAGES if len(lang) == 2}
LANGUAGES = {
lang: NATIVE_LANGUAGES.get(lang, display)
for lang, display in settings.ALL_LANGUAGES
}

TRANSLATION_BUTTONS = {
'add': '.metadata-video-translations .create-action',
Expand Down
6 changes: 3 additions & 3 deletions cms/djangoapps/contentstore/features/video.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Feature: CMS Video Component
# 1
Scenario: YouTube stub server proxies YouTube API correctly
Given youtube stub server proxies YouTube API
Given I have created a Video component
And I have created a Video component
Then I can see video button "play"
And I click video button "play"
Then I can see video button "pause"

# 2
Scenario: YouTube stub server can block YouTube API
Given youtube stub server blocks YouTube API
Given I have created a Video component
Given We explicitly wait for YouTube API to not load
And I have created a Video component
And I wait for "3" seconds
Then I do not see video button "play"

# 3
Expand Down
Loading