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
1941474a
Commit
1941474a
authored
Oct 21, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing test for range element in slider.
parent
644af346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
18 deletions
+34
-18
cms/djangoapps/contentstore/features/video.feature
+5
-5
cms/djangoapps/contentstore/features/video.py
+29
-13
No files found.
cms/djangoapps/contentstore/features/video.feature
View file @
1941474a
...
...
@@ -82,8 +82,8 @@ Feature: CMS.Video Component
Scenario
:
When
start end end times are specified, a range on slider is shown
Given
I have created a Video component
And
I edit the component
And
Enter a start time of 10 seconds
And
Enter an end time of 20 seconds
And
I
close the component editor
And
I click
Play button
Then
I see a range on slider
starting at 20 and running for 40 %
And
I set value
"12"
to the field
"Start Time"
And
I set value
"24"
to the field
"End Time"
And
I
save changes
And
I click
button
"Play"
Then
I see a range on slider
with styles
"left"
set to 10 and
"width"
set to 10
cms/djangoapps/contentstore/features/video.py
View file @
1941474a
...
...
@@ -9,9 +9,11 @@ BUTTONS = {
'CC'
:
'.hide-subtitles'
,
'volume'
:
'.volume'
,
'Play'
:
'.video_control.play'
,
'Save'
:
'save-button'
,
}
# We should wait 300 ms for event handler invocation + 200ms for safety.
DELAY
=
0.5
@step
(
'I have created a Video component$'
)
def
i_created_a_video_component
(
step
):
...
...
@@ -176,25 +178,39 @@ def caption_line_has_class(_step, index, className):
world
.
css_has_class
(
SELECTOR
,
className
.
strip
())
@step
(
'Enter (?:a|an) (.+) time of (.+) seconds$'
)
def
enter_start_end_time
(
_step
,
type_of_time
,
time
):
type_of_time
=
type_of_time
.
strip
()
time
=
int
(
time
.
strip
())
@step
(
'I set value "([^"]*)" to the field "([^"]*)"$'
)
def
set_value_transcripts_field
(
_step
,
value
,
field_name
):
world
.
wait
(
DELAY
)
world
.
wait_for_ajax_complete
()
field_id
=
'#'
+
world
.
browser
.
find_by_xpath
(
'//label[text()="
%
s"]'
%
field_name
.
strip
())[
0
][
'for'
]
world
.
css_fill
(
field_id
,
value
.
strip
())
@step
(
'I click (.+) button$'
)
def
click_a_button
(
_step
,
button
):
button
=
button
.
strip
(
button
)
world
.
browser
.
find_by_css
(
BUTTONS
[
button
])
.
click
()
@step
(
'I save changes$'
)
def
save_changes
(
_step
):
world
.
wait
(
DELAY
)
world
.
wait_for_ajax_complete
()
save_css
=
'a.save-button'
world
.
css_click
(
save_css
)
@step
(
'I close the component editor$'
)
def
close_component_editor
(
_step
):
_step
.
given
(
'I click Save button'
)
@step
(
'I click button "([^"]*)"$'
)
def
click_button
(
_step
,
button_type
):
world
.
wait
(
DELAY
)
world
.
wait_for_ajax_complete
()
button
=
button_type
.
strip
()
world
.
css_click
(
BUTTONS
[
button
])
@step
(
'I see a range on slider
starting at (.+) and running for (.+)
%
$'
)
@step
(
'I see a range on slider
with styles "left" set to (.+) and "width" set to (.+)
$'
)
def
see_a_range_slider_with_proper_range
(
_step
,
left
,
width
):
left
=
int
(
left
.
strip
())
width
=
int
(
width
.
strip
())
world
.
wait_for_visible
(
".slider-range"
)
slider_range
=
world
.
css_find
(
".slider-range"
)[
0
]
assert
"left: {}
%
;"
.
format
(
left
)
in
slider_range
.
outer_html
assert
"width: {}
%
;"
.
format
(
width
)
in
slider_range
.
outer_html
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