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
60795564
Commit
60795564
authored
Apr 22, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7764 from edx/parse-time-as-standalone-function
_parse_time_str can be a standalone function
parents
6050d07d
764d5e6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
common/test/acceptance/pages/lms/video/video.py
+16
-15
No files found.
common/test/acceptance/pages/lms/video/video.py
View file @
60795564
...
@@ -703,20 +703,6 @@ class VideoPage(PageObject):
...
@@ -703,20 +703,6 @@ class VideoPage(PageObject):
'State is {state}'
.
format
(
state
=
state
)
'State is {state}'
.
format
(
state
=
state
)
)
)
def
_parse_time_str
(
self
,
time_str
):
"""
Parse a string of the form 1:23 into seconds (int).
Arguments:
time_str (str): seek value
Returns:
int: seek value in seconds
"""
time_obj
=
time
.
strptime
(
time_str
,
'
%
M:
%
S'
)
return
time_obj
.
tm_min
*
60
+
time_obj
.
tm_sec
def
seek
(
self
,
seek_value
):
def
seek
(
self
,
seek_value
):
"""
"""
Seek the video to position specified by `seek_value`.
Seek the video to position specified by `seek_value`.
...
@@ -725,7 +711,7 @@ class VideoPage(PageObject):
...
@@ -725,7 +711,7 @@ class VideoPage(PageObject):
seek_value (str): seek value
seek_value (str): seek value
"""
"""
seek_time
=
self
.
_parse_time_str
(
seek_value
)
seek_time
=
_parse_time_str
(
seek_value
)
seek_selector
=
self
.
get_element_selector
(
' .video'
)
seek_selector
=
self
.
get_element_selector
(
' .video'
)
js_code
=
"$('{seek_selector}').data('video-player-state').videoPlayer.onSlideSeek({{time: {seek_time}}})"
.
format
(
js_code
=
"$('{seek_selector}').data('video-player-state').videoPlayer.onSlideSeek({{time: {seek_time}}})"
.
format
(
seek_selector
=
seek_selector
,
seek_time
=
seek_time
)
seek_selector
=
seek_selector
,
seek_time
=
seek_time
)
...
@@ -811,3 +797,18 @@ class VideoPage(PageObject):
...
@@ -811,3 +797,18 @@ class VideoPage(PageObject):
"""
"""
captions_rendered_selector
=
self
.
get_element_selector
(
CSS_CLASS_NAMES
[
'captions_rendered'
])
captions_rendered_selector
=
self
.
get_element_selector
(
CSS_CLASS_NAMES
[
'captions_rendered'
])
self
.
wait_for_element_presence
(
captions_rendered_selector
,
'Captions Rendered'
)
self
.
wait_for_element_presence
(
captions_rendered_selector
,
'Captions Rendered'
)
def
_parse_time_str
(
time_str
):
"""
Parse a string of the form 1:23 into seconds (int).
Arguments:
time_str (str): seek value
Returns:
int: seek value in seconds
"""
time_obj
=
time
.
strptime
(
time_str
,
'
%
M:
%
S'
)
return
time_obj
.
tm_min
*
60
+
time_obj
.
tm_sec
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