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
55aaa1a8
Commit
55aaa1a8
authored
Jun 03, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lettuce tests for single-click video creation and fix previously failing tests.
parent
cce65ce9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
7 deletions
+30
-7
cms/djangoapps/contentstore/features/common.py
+8
-0
cms/djangoapps/contentstore/features/component_settings_editor_helpers.py
+11
-7
cms/djangoapps/contentstore/features/video.feature
+4
-0
cms/djangoapps/contentstore/features/video.py
+7
-0
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
55aaa1a8
...
@@ -161,3 +161,11 @@ def i_created_a_video_component(step):
...
@@ -161,3 +161,11 @@ def i_created_a_video_component(step):
'i4x://edx/templates/video/default'
,
'i4x://edx/templates/video/default'
,
'.xmodule_VideoModule'
'.xmodule_VideoModule'
)
)
@step
(
'I have clicked the new unit button'
)
def
open_new_unit
(
step
):
step
.
given
(
'I have opened a new course section in Studio'
)
step
.
given
(
'I have added a new subsection'
)
step
.
given
(
'I expand the first section'
)
world
.
css_click
(
'a.new-unit-item'
)
cms/djangoapps/contentstore/features/component_settings_editor_helpers.py
View file @
55aaa1a8
...
@@ -14,19 +14,23 @@ def create_component_instance(step, component_button_css, instance_id, expected_
...
@@ -14,19 +14,23 @@ def create_component_instance(step, component_button_css, instance_id, expected_
@world.absorb
@world.absorb
def
click_new_component_button
(
step
,
component_button_css
):
def
click_new_component_button
(
step
,
component_button_css
):
step
.
given
(
'I have opened a new course section in Studio'
)
# step.given('I have opened a new course section in Studio')
step
.
given
(
'I have added a new subsection'
)
# step.given('I have added a new subsection')
step
.
given
(
'I expand the first section'
)
# step.given('I expand the first section')
world
.
css_click
(
'a.new-unit-item'
)
# world.css_click('a.new-unit-item')
step
.
given
(
'I have clicked the new unit button'
)
world
.
css_click
(
component_button_css
)
world
.
css_click
(
component_button_css
)
@world.absorb
@world.absorb
def
click_component_from_menu
(
instance_id
,
expected_css
):
def
click_component_from_menu
(
instance_id
,
expected_css
):
elem_css
=
"a[data-location='
%
s']"
%
instance_id
elem_css
=
"a[data-location='
%
s']"
%
instance_id
assert_equal
(
1
,
len
(
world
.
css_find
(
elem_css
)))
elements
=
world
.
css_find
(
elem_css
)
world
.
css_click
(
elem_css
)
if
len
(
elements
)
==
1
:
# Multiple templates
assert_equal
(
1
,
len
(
world
.
css_find
(
expected_css
)))
world
.
css_click
(
elem_css
)
assert_equal
(
1
,
len
(
world
.
css_find
(
expected_css
)))
else
:
# Single template
assert
(
len
(
filter
(
lambda
ele
:
ele
.
has_class
(
'single_template'
),
elements
))
==
1
)
@world.absorb
@world.absorb
def
edit_component_and_select_settings
():
def
edit_component_and_select_settings
():
...
...
cms/djangoapps/contentstore/features/video.feature
View file @
55aaa1a8
...
@@ -4,3 +4,7 @@ Feature: Video Component
...
@@ -4,3 +4,7 @@ Feature: Video Component
Scenario
:
Autoplay is disabled in Studio
Scenario
:
Autoplay is disabled in Studio
Given
I have created a Video component
Given
I have created a Video component
Then
when I view the video it does not have autoplay enabled
Then
when I view the video it does not have autoplay enabled
Scenario
:
Creating a video takes a single click
Given
I have clicked the new unit button
Then
creating a video takes a single click
cms/djangoapps/contentstore/features/video.py
View file @
55aaa1a8
...
@@ -9,3 +9,10 @@ from lettuce import world, step
...
@@ -9,3 +9,10 @@ from lettuce import world, step
def
does_not_autoplay
(
step
):
def
does_not_autoplay
(
step
):
assert
world
.
css_find
(
'.video'
)[
0
][
'data-autoplay'
]
==
'False'
assert
world
.
css_find
(
'.video'
)[
0
][
'data-autoplay'
]
==
'False'
assert
world
.
css_find
(
'.video_control'
)[
0
]
.
has_class
(
'play'
)
assert
world
.
css_find
(
'.video_control'
)[
0
]
.
has_class
(
'play'
)
@step
(
'creating a video takes a single click'
)
def
click_new_component_button
(
step
):
assert
(
not
world
.
is_css_present
(
'.xmodule_VideoModule'
))
world
.
css_click
(
"a[data-location='i4x://edx/templates/video/default']"
)
assert
(
world
.
is_css_present
(
'.xmodule_VideoModule'
))
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