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
af6c5efb
Commit
af6c5efb
authored
May 08, 2014
by
Muhammad Ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bok-Choy video tests batch4
parent
04376e08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
51 deletions
+61
-51
common/test/acceptance/pages/lms/course_nav.py
+0
-1
common/test/acceptance/pages/lms/video.py
+0
-0
common/test/acceptance/tests/helpers.py
+0
-20
common/test/acceptance/tests/test_video_module.py
+61
-8
lms/djangoapps/courseware/features/video.feature
+0
-22
No files found.
common/test/acceptance/pages/lms/course_nav.py
View file @
af6c5efb
...
...
@@ -102,7 +102,6 @@ class CourseNavPage(PageObject):
self
.
q
(
css
=
subsection_css
)
.
first
.
click
()
self
.
_on_section_promise
(
section_title
,
subsection_title
)
.
fulfill
()
def
go_to_sequential
(
self
,
sequential_title
):
"""
Within a section/subsection, navigate to the sequential with `sequential_title`.
...
...
common/test/acceptance/pages/lms/video.py
View file @
af6c5efb
This diff is collapsed.
Click to expand it.
common/test/acceptance/tests/helpers.py
View file @
af6c5efb
...
...
@@ -6,26 +6,6 @@ from bok_choy.web_app_test import WebAppTest
from
bok_choy.promise
import
EmptyPromise
def
wait_for_ajax
(
browser
,
try_limit
=
None
,
try_interval
=
0.5
,
timeout
=
60
):
"""
Make sure that all ajax requests are finished.
:param try_limit (int or None): Number of attempts to make to satisfy the `Promise`. Can be `None` to
disable the limit.
:param try_interval (float): Number of seconds to wait between attempts.
:param timeout (float): Maximum number of seconds to wait for the `Promise` to be satisfied before timing out.
:param browser: selenium.webdriver, The Selenium-controlled browser that this page is loaded in.
"""
def
_is_ajax_finished
():
"""
Check if all the ajax call on current page completed.
:return:
"""
return
browser
.
execute_script
(
"return jQuery.active"
)
==
0
EmptyPromise
(
_is_ajax_finished
,
"Finished waiting for ajax requests."
,
try_limit
=
try_limit
,
try_interval
=
try_interval
,
timeout
=
timeout
)
.
fulfill
()
def
load_data_str
(
rel_path
):
"""
Load a file from the "data" directory as a string.
...
...
common/test/acceptance/tests/test_video_module.py
View file @
af6c5efb
...
...
@@ -319,7 +319,7 @@ class YouTubeVideoTest(VideoBaseTest):
# check if we can download transcript in "srt" format that has text "好 各位同学"
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
)
def
test_download_button_two_transcript_languages
(
self
):
"""
...
...
@@ -343,10 +343,10 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
assertIn
(
'Hi, welcome to Edx.'
,
self
.
video
.
captions_text
)
# check if we can download transcript in "srt" format that has text "Hi, welcome to Edx."
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'Hi, welcome to Edx.'
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'Hi, welcome to Edx.'
)
)
# select language with code "zh"
self
.
video
.
select_language
(
'zh'
)
self
.
assertTrue
(
self
.
video
.
select_language
(
'zh'
)
)
# check if we see "好 各位同学" text in the captions
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
...
...
@@ -354,7 +354,7 @@ class YouTubeVideoTest(VideoBaseTest):
# check if we can download transcript in "srt" format that has text "好 各位同学"
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
)
def
test_fullscreen_video_alignment_on_transcript_toggle
(
self
):
"""
...
...
@@ -437,6 +437,59 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
assertTrue
(
self
.
video
.
is_video_rendered
(
'html5'
))
def
test_download_transcript_button_works_correctly
(
self
):
"""
Scenario: Download Transcript button works correctly
Given the course has Video components A and B in "Youtube" mode
And Video component C in "HTML5" mode
And I have defined downloadable transcripts for the videos
Then I can download a transcript for Video A in "srt" format
And I can download a transcript for Video A in "txt" format
And I can download a transcript for Video B in "txt" format
And the Download Transcript menu does not exist for Video C
"""
data_a
=
{
'sub'
:
'OEoXaMPEzfM'
,
'download_track'
:
True
}
youtube_a_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_a
)
self
.
assets
.
append
(
'subs_OEoXaMPEzfM.srt.sjson'
)
data_b
=
{
'youtube_id_1_0'
:
'b7xgknqkQk8'
,
'sub'
:
'b7xgknqkQk8'
,
'download_track'
:
True
}
youtube_b_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_b
)
self
.
assets
.
append
(
'subs_b7xgknqkQk8.srt.sjson'
)
data_c
=
{
'track'
:
'http://example.org/'
,
'download_track'
:
True
}
html5_c_metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data_c
)
self
.
verticals
=
[
[{
'display_name'
:
'A'
,
'metadata'
:
youtube_a_metadata
}],
[{
'display_name'
:
'B'
,
'metadata'
:
youtube_b_metadata
}],
[{
'display_name'
:
'C'
,
'metadata'
:
html5_c_metadata
}]
]
# open the section with videos (open video "A")
self
.
navigate_to_video
()
# check if we can download transcript in "srt" format that has text "00:00:00,270"
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'00:00:00,270'
))
# select the transcript format "txt"
self
.
assertTrue
(
self
.
video
.
select_transcript_format
(
'txt'
))
# check if we can download transcript in "txt" format that has text "Hi, welcome to Edx."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'txt'
,
'Hi, welcome to Edx.'
))
# open video "B"
self
.
course_nav
.
go_to_sequential
(
'B'
)
# check if we can download transcript in "txt" format that has text "Equal transcripts"
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'txt'
,
'Equal transcripts'
))
# open video "C"
self
.
course_nav
.
go_to_sequential
(
'C'
)
# menu "download_transcript" doesn't exist
self
.
assertFalse
(
self
.
video
.
is_menu_exist
(
'download_transcript'
))
class
YouTubeHtml5VideoTest
(
VideoBaseTest
):
""" Test YouTube HTML5 Video Player """
...
...
@@ -517,7 +570,7 @@ class Html5VideoTest(VideoBaseTest):
# check if we can download transcript in "srt" format that has text "好 各位同学"
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
)
def
test_download_button_two_transcript_languages
(
self
):
"""
...
...
@@ -541,10 +594,10 @@ class Html5VideoTest(VideoBaseTest):
self
.
assertIn
(
'Hi, welcome to Edx.'
,
self
.
video
.
captions_text
)
# check if we can download transcript in "srt" format that has text "Hi, welcome to Edx."
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'Hi, welcome to Edx.'
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'Hi, welcome to Edx.'
)
)
# select language with code "zh"
self
.
video
.
select_language
(
'zh'
)
self
.
assertTrue
(
self
.
video
.
select_language
(
'zh'
)
)
# check if we see "好 各位同学" text in the captions
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
...
...
@@ -553,7 +606,7 @@ class Html5VideoTest(VideoBaseTest):
#Then I can download transcript in "srt" format that has text "好 各位同学"
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
unicode_text
)
)
def
test_full_screen_video_alignment_with_transcript_visible
(
self
):
"""
...
...
lms/djangoapps/courseware/features/video.feature
View file @
af6c5efb
...
...
@@ -67,28 +67,6 @@ Feature: LMS.Video component
And
I select language with code
"en"
And
I see
"Hi, welcome to Edx."
text in the captions
# 5
Scenario
:
Download Transcript button works correctly in Video component
Given
I am registered for the course
"test_course"
And
I have a
"subs_OEoXaMPEzfM.srt.sjson"
transcript file in assets
And it has a video "A" in "Youtube" mode in position "1" of sequential
:
|
sub
|
download_track
|
|
OEoXaMPEzfM
|
true
|
And a video "B" in "Youtube" mode in position "2" of sequential
:
|
sub
|
download_track
|
|
OEoXaMPEzfM
|
true
|
And a video "C" in "Youtube" mode in position "3" of sequential
:
|
track
|
download_track
|
|
http://example.org/
|
true
|
And
I open the section with videos
Then I can download transcript in "srt" format that has text "00
:
00
:
00,270"
And
I select the transcript format
"txt"
Then
I can download transcript in
"txt"
format that has text
"Hi, welcome to Edx."
When
I open video
"B"
Then
I can download transcript in
"txt"
format that has text
"Hi, welcome to Edx."
When
I open video
"C"
Then
menu
"download_transcript"
doesn't exist
# 9
# Scenario: Youtube video has correct transcript if fields for other speeds are filled
# Given I am registered for the course "test_course"
...
...
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