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
2efee4eb
Commit
2efee4eb
authored
Aug 28, 2014
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4939 from edx/ammar/bok-choy-transcript-tests-batch3
Bok-Choy Video Transcript Tests Batch3
parents
50535ac8
6b2874de
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
474 additions
and
265 deletions
+474
-265
cms/djangoapps/contentstore/features/transcripts.feature
+0
-257
common/test/acceptance/pages/studio/video/video.py
+20
-1
common/test/acceptance/tests/video/test_studio_video_transcript.py
+454
-7
No files found.
cms/djangoapps/contentstore/features/transcripts.feature
View file @
2efee4eb
...
...
@@ -82,260 +82,3 @@ Feature: CMS Transcripts
# And I see button "use_existing"
# And I click transcript button "use_existing"
# And I see value "video_name_3" in the field "Default Timed Transcript"
#26
Scenario
:
Subtitles are copied for every html5 video source
Given
I have created a Video component
And
I edit the component
And
I enter a
"video_name_1.mp4"
source to field number 1
And
I see status message
"not found"
And
I enter a
"video_name_2.webm"
source to field number 2
And
I see status message
"not found"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I see value
"video_name_1|video_name_2"
in the field
"Default Timed Transcript"
And
I clear field number 1
Then
I see status message
"found"
And
I see value
"video_name_2"
in the field
"Default Timed Transcript"
#27
Scenario
:
Upload button for single youtube id
Given
I have created a Video component
And
I edit the component
And I enter a "http
:
//youtu.be/t_not_exist"
source
to
field
number
1
Then
I see status message
"not found"
And
I see button
"upload_new_timed_transcripts"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
#28
Scenario
:
Upload button for youtube id with html5 ids
Given
I have created a Video component
And
I edit the component
And I enter a "http
:
//youtu.be/t_not_exist"
source
to
field
number
1
Then
I see status message
"not found"
And
I see button
"upload_new_timed_transcripts"
And
I enter a
"video_name_1.mp4"
source to field number 2
Then
I see status message
"not found"
And
I see button
"upload_new_timed_transcripts"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I clear field number 1
Then
I see status message
"found"
And
I see value
"video_name_1"
in the field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
#29
Scenario
:
Change transcripts field in Advanced tab
Given
I have created a Video component with subtitles
"t_not_exist"
And
I edit the component
And
I enter a
"video_name_1.mp4"
source to field number 1
Then
I see status message
"not found"
And
I open tab
"Advanced"
And
I set value
"t_not_exist"
to the field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
And
I see value
"video_name_1"
in the field
"Default Timed Transcript"
#30
Scenario
:
Check non-ascii (chinise) transcripts
Given
I have created a Video component
And
I edit the component
And
I enter a
"video_name_1.mp4"
source to field number 1
Then
I see status message
"not found"
And
I upload the transcripts file
"chinese_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I save changes
Then
when I view the video it does show the captions
#31
Scenario
:
Check saving module metadata on switching between tabs
Given
I have created a Video component with subtitles
"t_not_exist"
And
I edit the component
And
I enter a
"video_name_1.mp4"
source to field number 1
Then
I see status message
"not found"
And
I open tab
"Advanced"
And
I set value
"t_not_exist"
to the field
"Default Timed Transcript"
And
I open tab
"Basic"
Then
I see status message
"found"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
And
I see value
"video_name_1"
in the field
"Default Timed Transcript"
#32
Scenario
:
After clearing Transcripts field in the Advanced tab "not found" message should be visible w/o saving
Given
I have created a Video component
And
I edit the component
And
I enter a
"t_not_exist.mp4"
source to field number 1
Then
I see status message
"not found"
And
I upload the transcripts file
"chinese_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I open tab
"Advanced"
And
I set value
""
to the field
"Default Timed Transcript"
And
I open tab
"Basic"
Then
I see status message
"not found"
And
I save changes
Then
when I view the video it does not show the captions
And
I edit the component
Then
I see status message
"not found"
And
I see value
""
in the field
"Default Timed Transcript"
#33
Scenario
:
After clearing Transcripts field in the Advanced tab "not found" message should be visible with saving
Given
I have created a Video component
And
I edit the component
And
I enter a
"t_not_exist.mp4"
source to field number 1
Then
I see status message
"not found"
And
I upload the transcripts file
"chinese_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I save changes
Then
I see
"好 各位同学"
text in the captions
And
I edit the component
And
I open tab
"Advanced"
And
I set value
""
to the field
"Default Timed Transcript"
And
I open tab
"Basic"
Then
I see status message
"not found"
And
I save changes
Then
when I view the video it does not show the captions
And
I edit the component
Then
I see status message
"not found"
And
I see value
""
in the field
"Default Timed Transcript"
#34
Scenario
:
Video with existing subs - Advanced tab - change to another one subs - Basic tab - Found message - Save - see correct subs
Given
I have created a Video component with subtitles
"t_not_exist"
And
I edit the component
And
I enter a
"video_name_1.mp4"
source to field number 1
Then
I see status message
"not found"
And
I upload the transcripts file
"chinese_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I save changes
Then
when I view the video it does show the captions
And
I see
"好 各位同学"
text in the captions
And
I edit the component
And
I open tab
"Advanced"
And
I set value
"t_not_exist"
to the field
"Default Timed Transcript"
And
I open tab
"Basic"
Then
I see status message
"found"
And
I save changes
Then
when I view the video it does show the captions
And I see "LILA FISHER
:
Hi,
welcome
to
Edx."
text
in
the
captions
#35
Scenario
:
After reverting Transcripts field in the Advanced tab "not found" message should be visible
Given
I have created a Video component
And
I edit the component
And
I enter a
"t_not_exist.mp4"
source to field number 1
Then
I see status message
"not found"
And
I upload the transcripts file
"chinese_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I save changes
Then
I see
"好 各位同学"
text in the captions
And
I edit the component
And
I open tab
"Advanced"
And
I revert the transcript field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does not show the captions
And
I edit the component
Then
I see status message
"not found"
#36 Uploading subtitles for file with periods in it should properly set the transcript name and keep the periods
Scenario
:
File name and name of subs are different
Given
I have created a Video component
And
I edit the component
And
I enter a
"video_name_1.1.2.mp4"
source to field number 1
And
I see status message
"not found"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I see value
"video_name_1.1.2"
in the field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
#37 Uploading subtitles with different file name than file
Scenario
:
Shortened link
:
File
name
and
name
of
subs
are
different
Given
I have created a Video component
And
I edit the component
And I enter a "http
:
//goo.gl/pxxZrg"
source
to
field
number
1
And
I see status message
"not found"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I see value
"pxxZrg"
in the field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
#38 Uploading subtitles with different file name than file
Scenario
:
Relative link
:
File
name
and
name
of
subs
are
different
Given
I have created a Video component
And
I edit the component
And
I enter a
"/gizmo.webm"
source to field number 1
And
I see status message
"not found"
And
I upload the transcripts file
"uk_transcripts.srt"
Then
I see status message
"uploaded_successfully"
And
I see value
"gizmo"
in the field
"Default Timed Transcript"
And
I save changes
Then
when I view the video it does show the captions
And
I edit the component
Then
I see status message
"found"
common/test/acceptance/pages/studio/video/video.py
View file @
2efee4eb
...
...
@@ -503,7 +503,6 @@ class VideoComponentPage(VideoPage):
self
.
click_button
(
'collapse_link'
)
self
.
q
(
css
=
CLASS_SELECTORS
[
'url_inputs'
])
.
nth
(
field_number
-
1
)
.
fill
(
url
)
time
.
sleep
(
DELAY
)
self
.
wait_for_ajax
()
...
...
@@ -548,6 +547,19 @@ class VideoComponentPage(VideoPage):
return
statuses
def
clear_field
(
self
,
index
):
"""
Clear a video url field at index specified by `index`.
"""
self
.
q
(
css
=
CLASS_SELECTORS
[
'url_inputs'
])
.
nth
(
index
-
1
)
.
fill
(
''
)
# Trigger an 'input' event after filling the field with an empty value.
self
.
browser
.
execute_script
(
"$('{}:eq({})').trigger('{}')"
.
format
(
CLASS_SELECTORS
[
'url_inputs'
],
index
,
'input'
))
time
.
sleep
(
DELAY
)
self
.
wait_for_ajax
()
def
clear_fields
(
self
):
"""
Clear video url fields.
...
...
@@ -563,6 +575,13 @@ class VideoComponentPage(VideoPage):
time
.
sleep
(
DELAY
)
self
.
wait_for_ajax
()
def
revert_field
(
self
,
field_name
):
"""
Revert a field.
"""
_
,
setting
=
self
.
_get_setting_entry
(
field_name
)
setting
.
find_element_by_class_name
(
'setting-clear'
)
.
click
()
def
is_transcript_button_visible
(
self
,
button_name
,
index
=
0
,
button_text
=
None
):
"""
Check if a transcript related button is visible.
...
...
common/test/acceptance/tests/video/test_studio_video_transcript.py
View file @
2efee4eb
...
...
@@ -48,34 +48,42 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Check input error messages
Given I have created a Video component
Entering "123.webm" and "456.webm" source to field number 1 and 2 respectively should disable field 1 and 3
Then I see error message "Link types should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://link.c" source to field number 1 should disable fields 2 and 3
Then I see error message "Incorrect url format."
Entering "http://goo.gl/pxxZrg" source to both field number 1 and 2 should disable fields 1 and 3
Then I see error message "Links should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I do not see error message
And I expect inputs are enabled
"""
self
.
_create_video_component
()
self
.
edit_component
()
#User inputs html5 links with equal extension
self
.
video
.
set_url_field
(
'123.webm'
,
1
)
self
.
video
.
set_url_field
(
'456.webm'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'error'
),
'Link types should be unique.'
)
# Currently we are working with 2nd field. It means, that if 2nd field
# contain incorrect value, 1st and 3rd fields should be disabled until
# 2nd field will be filled by correct correct value
self
.
assertEqual
(
self
.
video
.
url_field_status
(
1
,
3
)
.
values
(),
[
False
,
False
])
self
.
video
.
clear_fields
()
self
.
assertEqual
(
self
.
video
.
url_field_status
()
.
values
(),
[
True
,
True
,
True
])
#User input URL with incorrect format
self
.
video
.
set_url_field
(
'http://link.c'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'error'
),
'Incorrect url format.'
)
self
.
assertEqual
(
self
.
video
.
url_field_status
(
2
,
3
)
.
values
(),
[
False
,
False
])
#User input URL with incorrect format
self
.
video
.
set_url_field
(
'http://goo.gl/pxxZrg'
,
1
)
self
.
video
.
set_url_field
(
'http://goo.gl/pxxZrg'
,
2
)
...
...
@@ -83,6 +91,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self
.
assertEqual
(
self
.
video
.
url_field_status
(
1
,
3
)
.
values
(),
[
False
,
False
])
self
.
video
.
clear_fields
()
self
.
assertEqual
(
self
.
video
.
url_field_status
()
.
values
(),
[
True
,
True
,
True
])
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'error'
),
''
)
self
.
assertEqual
(
self
.
video
.
url_field_status
()
.
values
(),
[
True
,
True
,
True
])
...
...
@@ -91,9 +100,11 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Testing interaction with test youtube server
Given I have created a Video component with subtitles
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
Then I see status message "No EdX Timed Transcript"
And I see button "import"
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I see status message "No Timed Transcript"
And I do not see button "import"
...
...
@@ -101,11 +112,13 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
)
self
.
edit_component
()
# first part of url will be substituted by mock_youtube_server address
# for t__eq_exist id server will respond with transcripts
self
.
video
.
set_url_field
(
'http://youtu.be/t__eq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No EdX Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'import'
))
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertFalse
(
self
.
video
.
is_transcript_button_visible
(
'import'
))
...
...
@@ -115,12 +128,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Youtube id only: check "Found" state
Given I have created a Video component with subtitles "t_not_exist"
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I see status message "Timed Transcript Found"
And I see value "t_not_exist" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
open_advanced_tab
()
...
...
@@ -130,12 +145,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Youtube id only: check "Found" state when user sets youtube_id with same local and server subs
Given I have created a Video component with subtitles "t__eq_exist"
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
And I see status message "Timed Transcript Found"
And I see value "t__eq_exist" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't__eq_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t__eq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
open_advanced_tab
()
...
...
@@ -145,6 +162,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Youtube id only: check "Found" state when user sets youtube_id with different local and server subs
Given I have created a Video component with subtitles "t_neq_exist"
And I enter a "http://youtu.be/t_neq_exist" source to field number 1
And I see status message "Timed Transcript Conflict"
And I see button "replace"
...
...
@@ -154,6 +172,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t_neq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Conflict'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'replace'
))
...
...
@@ -166,12 +185,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: html5 source only: check "Not Found" state
Given I have created a Video component
And I enter a "t_not_exist.mp4" source to field number 1
Then I see status message "No Timed Transcript"
And I see value "" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
open_advanced_tab
()
...
...
@@ -181,12 +202,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: html5 source only: check "Found" state
Given I have created a Video component with subtitles "t_not_exist"
And I enter a "t_not_exist.mp4" source to field number 1
Then I see status message "Timed Transcript Found"
And I see value "t_not_exist" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
open_advanced_tab
()
...
...
@@ -196,6 +219,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: User sets youtube_id w/o server but with local subs and one html5 link w/o subs
Given I have created a Video component with subtitles "t_not_exist"
urls = ['http://youtu.be/t_not_exist', 'test_video_name.mp4']
for each url in urls do the following
Enter `url` to field number n
...
...
@@ -204,6 +228,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
urls
=
[
'http://youtu.be/t_not_exist'
,
'test_video_name.mp4'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -217,6 +242,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
Scenario: User sets youtube_id w/o local but with server subs and one html5 link w/o
transcripts w/o import action, then another one html5 link w/o transcripts
Given I have created a Video component
urls = ['http://youtu.be/t__eq_exist', 't_not_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -225,6 +251,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
()
self
.
edit_component
()
urls
=
[
'http://youtu.be/t__eq_exist'
,
't_not_exist.mp4'
,
't_not_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -236,6 +263,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube (no importing), and 2 html5 sources without transcripts - "Not Found"
Given I have created a Video component
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -244,6 +272,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
()
self
.
edit_component
()
urls
=
[
'http://youtu.be/t_not_exist'
,
't_not_exist.mp4'
,
't_not_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -255,12 +284,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube with imported transcripts, and 2 html5 sources without transcripts - "Found"
Given I have created a Video component
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
Then I see status message "No EdX Timed Transcript"
And I see button "import"
And I click transcript button "import"
Then I see status message "Timed Transcript Found"
And I see button "upload_new_timed_transcripts"
urls = ['t_not_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -269,12 +300,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t__eq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No EdX Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'import'
))
self
.
video
.
click_button
(
'import'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
urls
=
[
't_not_exist.mp4'
,
't_not_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
2
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -286,6 +319,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube w/o transcripts - html5 w/o transcripts - html5 with transcripts
Given I have created a Video component with subtitles "t_neq_exist"
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -298,6 +332,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
urls
=
[
'http://youtu.be/t_not_exist'
,
't_not_exist.mp4'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -314,6 +349,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube w/o imported transcripts - html5 w/o transcripts w/o import - html5 with transcripts
Given I have created a Video component with subtitles "t_neq_exist"
urls = ['http://youtu.be/t__eq_exist', 't_not_exist.mp4', 't_neq_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -322,6 +358,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
urls
=
[
'http://youtu.be/t__eq_exist'
,
't_not_exist.mp4'
,
't_neq_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -333,6 +370,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube w/o imported transcripts - html5 with transcripts - html5 w/o transcripts w/o import
Given I have created a Video component with subtitles "t_neq_exist"
urls = ['http://youtu.be/t__eq_exist', 't_neq_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -341,6 +379,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
urls
=
[
'http://youtu.be/t__eq_exist'
,
't_neq_exist.mp4'
,
't_not_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
1
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -352,12 +391,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube with imported transcripts - html5 with transcripts - html5 w/o transcripts
Given I have created a Video component with subtitles "t_neq_exist"
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
Then I see status message "No EdX Timed Transcript"
And I see button "import"
And I click transcript button "import"
Then I see status message "Timed Transcript Found"
And I see button "upload_new_timed_transcripts"
urls = ['t_neq_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -366,12 +407,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t__eq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No EdX Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'import'
))
self
.
video
.
click_button
(
'import'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
urls
=
[
't_neq_exist.mp4'
,
't_not_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
2
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -383,12 +426,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering youtube with imported transcripts - html5 w/o transcripts - html5 with transcripts
Given I have created a Video component with subtitles "t_neq_exist"
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
Then I see status message "No EdX Timed Transcript"
And I see button "import"
And I click transcript button "import"
Then I see status message "Timed Transcript Found"
And I see button "upload_new_timed_transcripts"
urls = ['t_not_exist.mp4', 't_neq_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
...
...
@@ -397,12 +442,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_neq_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t__eq_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No EdX Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'import'
))
self
.
video
.
click_button
(
'import'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
urls
=
[
't_not_exist.mp4'
,
't_neq_exist.webm'
]
for
index
,
url
in
enumerate
(
urls
,
2
):
self
.
video
.
set_url_field
(
url
,
index
)
...
...
@@ -414,6 +461,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Entering html5 with transcripts - upload - youtube w/o transcripts
Given I have created a Video component with subtitles "t__eq_exist"
And I enter a "t__eq_exist.mp4" source to field number 1
Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
...
...
@@ -421,14 +469,17 @@ class VideoTranscriptTest(CMSVideoBaseTest):
Then I see status message "Timed Transcript Uploaded Successfully"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I see value "t__eq_exist" in the field "Default Timed Transcript"
And I enter a "http://youtu.be/t_not_exist" source to field number 2
Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I enter a "uk_transcripts.webm" source to field number 3
Then I see status message "Timed Transcript Found"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't__eq_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
't__eq_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'download_to_edit'
))
...
...
@@ -440,10 +491,12 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
't__eq_exist'
))
self
.
open_basic_tab
()
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'download_to_edit'
))
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
self
.
video
.
set_url_field
(
'uk_transcripts.webm'
,
3
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
...
...
@@ -451,12 +504,14 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: Enter 2 HTML5 sources with transcripts, they are not the same, choose
Given I have created a Video component with subtitles "t_not_exist"
And I enter a "uk_transcripts.mp4" source to field number 1
Then I see status message "No Timed Transcript"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I upload the transcripts file "uk_transcripts.srt"
Then I see status message "Timed Transcript Uploaded Successfully"
And I see value "uk_transcripts" in the field "Default Timed Transcript"
And I enter a "t_not_exist.webm" source to field number 2
Then I see status message "Timed Transcript Conflict"
`Timed Transcript from uk_transcripts.mp4` and `Timed Transcript from t_not_exist.webm` buttons are shown
...
...
@@ -465,6 +520,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'uk_transcripts.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'download_to_edit'
))
...
...
@@ -474,6 +530,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'uk_transcripts'
))
self
.
open_basic_tab
()
self
.
video
.
set_url_field
(
't_not_exist.webm'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Conflict'
)
self
.
assertTrue
(
...
...
@@ -483,25 +540,31 @@ class VideoTranscriptTest(CMSVideoBaseTest):
def
test_one_field_only
(
self
):
"""
Scenario: Work with 1 field only: Enter HTML5 source with transcripts - save -> change it to another one HTML5
source w/o transcripts - click on use existing -> change it to another one HTML5 source w/o transcripts - do
not click on use existing -> change it to another one HTML5 source w/o transcripts - click on use existing
Scenario: Work with 1 field only: Enter HTML5 source with transcripts - save -> change it to another one
HTML5 source w/o transcripts - click on use existing -> change it to another one HTML5 source
w/o transcripts - do not click on use existing -> change it to another one HTML5 source w/o
transcripts - click on use existing
Given I have created a Video component with subtitles "t_not_exist"
If i enter "t_not_exist.mp4" source to field number 1 Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I see value "t_not_exist" in the field "Default Timed Transcript"
And I save changes And then edit the component
If i enter "video_name_2.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
I see button "use_existing" And I click on it
And I see value "video_name_2" in the field "Default Timed Transcript"
If i enter "video_name_3.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
And I see button "use_existing"
If i enter a "video_name_4.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
I see button "use_existing" And I click on it
And I see value "video_name_4" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'download_to_edit'
))
...
...
@@ -511,6 +574,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self
.
open_basic_tab
()
self
.
save_unit_settings
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_2.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Confirm Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'use_existing'
))
...
...
@@ -519,9 +583,11 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_2'
))
self
.
open_basic_tab
()
self
.
video
.
set_url_field
(
'video_name_3.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Confirm Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'use_existing'
))
self
.
video
.
set_url_field
(
'video_name_4.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Confirm Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'use_existing'
))
...
...
@@ -532,17 +598,20 @@ class VideoTranscriptTest(CMSVideoBaseTest):
def
test_two_fields_only
(
self
):
"""
Scenario: Work with 2 fields: Enter HTML5 source with transcripts - save -> change it to another one HTML5
source w/o transcripts - do not click on use existing -> add another one HTML5 source w/o transcripts -
click on use existing
source w/o transcripts - do not click on use existing -> add another one HTML5 source w/o
transcripts -
click on use existing
Given I have created a Video component with subtitles "t_not_exist"
And I enter a "t_not_exist.mp4" source to field number 1
Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I save changes
And I edit the component
And I enter a "video_name_2.mp4" source to field number 1
Then I see status message "Confirm Timed Transcript"
And I see button "use_existing"
And I enter a "video_name_3.webm" source to field number 2
Then I see status message "Confirm Timed Transcript"
And I see button "use_existing"
...
...
@@ -551,15 +620,18 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'download_to_edit'
))
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
self
.
save_unit_settings
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_2.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Confirm Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'use_existing'
))
self
.
video
.
set_url_field
(
'video_name_3.webm'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Confirm Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'use_existing'
))
...
...
@@ -571,6 +643,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
Scenario: File name and name of subs are different (Uploading subtitles with different file name than file)
Given I have created a Video component
And I enter a "video_name_1.mp4" source to field number 1
And I see status message "No Timed Transcript"
And I upload the transcripts file "uk_transcripts.srt"
...
...
@@ -583,6 +656,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
...
...
@@ -596,15 +670,388 @@ class VideoTranscriptTest(CMSVideoBaseTest):
def
test_video_wo_subtitles
(
self
):
"""
Scenario: Video w/o subs - another video w/o subs - Not found message
Video can have filled item.sub, but doesn't have subs file.
In this case, after changing this video by another one without subs
`No Timed Transcript` message should appear ( not `Confirm Timed Transcript`).
Scenario: Video w/o subs - another video w/o subs - Not found message
`No Timed Transcript` message should appear ( not 'Confirm Timed Transcript').
Given I have created a Video component
And I enter a "video_name_1.mp4" source to field number 1
Then I see status message "No Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
def
test_subtitles_copy
(
self
):
"""
Scenario: Subtitles are copied for every html5 video source
Given I have created a Video component
After I enter a "video_name_1.mp4" source to field number 1 Then I see status message "No Timed Transcript"
After I enter a "video_name_2.webm" source to field number 2 Then I see status message "No Timed Transcript"
After uploading transcript "uk_transcripts.srt" I should see message "Timed Transcript Uploaded Successfully"
And I see value "video_name_2" in the field "Default Timed Transcript"
When I clear field number 1 Then I see status message "Timed Transcript Found"
And I see value "video_name_2" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
set_url_field
(
'video_name_2.webm'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_2'
))
self
.
open_basic_tab
()
self
.
video
.
clear_field
(
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_2'
))
def
test_upload_button_w_youtube
(
self
):
"""
Scenario: Upload button for single youtube id
Given I have created a Video component
After I enter a "http://youtu.be/t_not_exist" source to field number 1 I see message "No Timed Transcript"
And I see button "upload_new_timed_transcripts"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes video captions should be visible
When I edit the component Then I see status message "Timed Transcript Found"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
def
test_upload_button_w_html5_ids
(
self
):
"""
Scenario: Upload button for youtube id with html5 ids
Given I have created a Video component
After I enter a "http://youtu.be/t_not_exist" source to field number 1 I see message "No Timed Transcript"
And I see button "upload_new_timed_transcripts"
After I enter a "video_name_1.mp4" source to field number 2 Then I see status message "No Timed Transcript"
And I see button "upload_new_timed_transcripts"
After I upload the transcripts file "uk_transcripts.srt"I see message "Timed Transcript Uploaded Successfully"
When I clear field number 1 Then I see status message "Timed Transcript Found"
And I see value "video_name_1" in the field "Default Timed Transcript"
After saving the changes video captions should be visible
When I edit the component Then I see status message "Timed Transcript Found"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://youtu.be/t_not_exist'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
2
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
is_transcript_button_visible
(
'upload_new_timed_transcripts'
))
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
video
.
clear_field
(
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_1'
))
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
def
test_advanced_tab_transcript_fields
(
self
):
"""
Scenario: Change transcripts field in Advanced tab
Given I have created a Video component with subtitles "t_not_exist"
After I enter a "video_name_1.mp4" source to field number 1 Then I see status message "No Timed Transcript"
Open tab "Advanced" and set value "t_not_exist" to the field "Default Timed Transcript"
After saving the changes video captions should be visible
When I edit the component Then I see status message "Timed Transcript Found"
And I see value "video_name_1" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
open_advanced_tab
()
self
.
video
.
set_field_value
(
'Default Timed Transcript'
,
't_not_exist'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_1'
))
def
test_non_ascii_transcripts
(
self
):
"""
Scenario: Check non-ascii (chinese) transcripts
Given I have created a Video component
After I enter a "video_name_1.mp4" source to field number 1 Then I see status message "No Timed Transcript"
After I upload the transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes video captions should be visible
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'chinese_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
def
test_module_metadata_save
(
self
):
"""
Scenario: Check saving module metadata on switching between tabs
Given I have created a Video component with subtitles "t_not_exist"
After I enter a "video_name_1.mp4" source to field number 1 I should see status message "No Timed Transcript"
Open tab "Advanced" and set value "t_not_exist" to the field "Default Timed Transcript"
When I open tab "Basic" Then I see status message "Timed Transcript Found"
After saving the changes video captions should be visible
When I edit the component I should see status message "Timed Transcript Found"
And I see value "video_name_1" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
open_advanced_tab
()
self
.
video
.
set_field_value
(
'Default Timed Transcript'
,
't_not_exist'
)
self
.
open_basic_tab
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_1'
))
def
test_clearing_transcripts_wo_save
(
self
):
"""
Scenario: After clearing Transcripts field in the Advanced tab "not found" message should be visible w/o saving
Given I have created a Video component
After I enter a "t_not_exist.mp4" source to field number 1 I should see status message "No Timed Transcript"
After uploading transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
Open tab "Advanced" and set value "" to the field "Default Timed Transcript"
When I open tab "Basic" I see status message "No Timed Transcript"
After saving the changes video captions should not be visible
When I edit the component I should see status message "No Timed Transcript"
And I see value "" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'chinese_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
open_advanced_tab
()
self
.
video
.
set_field_value
(
'Default Timed Transcript'
,
''
)
self
.
open_basic_tab
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
save_unit_settings
()
self
.
assertFalse
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
''
))
def
test_clearing_transcripts_w_save
(
self
):
"""
Scenario: After clearing Transcripts field in the Advanced tab "not found" message should be visible with saving
Given I have created a Video component
After I enter a "t_not_exist.mp4" source to field number 1 I see status message "No Timed Transcript"
After uploading the transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving changes I see "好 各位同学" text in the captions
And I edit the component
Open tab "Advanced" I set value "" to the field "Default Timed Transcript"
When I open tab "Basic" I see status message "No Timed Transcript"
After saving the changes video captions should not be visible
After I edit the component I should see status message "No Timed Transcript"
And I see value "" in the field "Default Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'chinese_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
save_unit_settings
()
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
)
self
.
edit_component
()
self
.
open_advanced_tab
()
self
.
video
.
set_field_value
(
'Default Timed Transcript'
,
''
)
self
.
open_basic_tab
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
save_unit_settings
()
self
.
assertFalse
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
''
))
def
test_video_w_existing_subtitles
(
self
):
"""
Scenario: Video with existing subs - Advanced tab - change to another one subs -
Basic tab - Found message - Save - see correct subs
Given I have created a Video component with subtitles "t_not_exist"
After I enter a "video_name_1.mp4" source to field number 1 I see status message "No Timed Transcript"
After uploading the transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes video captions should be visible
And I see "好 各位同学" text in the captions
And I edit the component
Open tab "Advanced" And set value "t_not_exist" to the field "Default Timed Transcript"
When I open tab "Basic" I should see status message "Timed Transcript Found"
After saving the changes video captions should be visible
And I see "LILA FISHER: Hi, welcome to Edx." text in the captions
"""
self
.
_create_video_component
(
subtitles
=
True
,
subtitle_id
=
't_not_exist'
)
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'chinese_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
)
self
.
edit_component
()
self
.
open_advanced_tab
()
self
.
video
.
set_field_value
(
'Default Timed Transcript'
,
't_not_exist'
)
self
.
open_basic_tab
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
assertIn
(
'LILA FISHER: Hi, welcome to Edx.'
,
self
.
video
.
captions_text
)
def
test_reverting_transcripts
(
self
):
"""
Scenario: After reverting Transcripts field in the Advanced tab "not found" message should be visible
Given I have created a Video component
After I enter a "t_not_exist.mp4" source to field number 1 Then I see status message "No Timed Transcript"
After uploading transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes I should see "好 各位同学" text in the captions
After I edit the component I open tab "Advanced"
And I revert the transcript field "Default Timed Transcript"
After saving the changes video captions should not be visible
After I edit the component I should see status message "No Timed Transcript"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
't_not_exist.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'chinese_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
save_unit_settings
()
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
)
self
.
edit_component
()
self
.
open_advanced_tab
()
self
.
video
.
revert_field
(
'Default Timed Transcript'
)
self
.
save_unit_settings
()
self
.
assertFalse
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
def
test_upload_subtitles_w_different_names2
(
self
):
"""
Scenario: File name and name of subs are different -- Uploading subtitles for file with periods
in it should properly set the transcript name and keep the periods
Given I have created a Video component
After I enter a "video_name_1.1.2.mp4" source to field number 1, I see status message "No Timed Transcript"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
And I see value "video_name_1.1.2" in the field "Default Timed Transcript"
After saving the changes video captions should be visible
After I edit the component I should see status message "Timed Transcript Found"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'video_name_1.1.2.mp4'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'video_name_1.1.2'
))
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
def
test_upload_subtitles_w_different_names3
(
self
):
"""
Scenario: Shortened link: File name and name of subs are different
Given I have created a Video component
After I enter a "http://goo.gl/pxxZrg" source to field number 1 Then I see status message "No Timed Transcript"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
And I see value "pxxZrg" in the field "Default Timed Transcript"
After saving the changes video captions should be visible
After I edit the component I should see status message "Timed Transcript Found"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'http://goo.gl/pxxZrg'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'pxxZrg'
))
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
def
test_upload_subtitles_w_different_names4
(
self
):
"""
Scenario: Relative link: File name and name of subs are different
Given I have created a Video component
After i enter a "/gizmo.webm" source to field number 1 Then I see status message "No Timed Transcript"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
And I see value "gizmo" in the field "Default Timed Transcript"
After saving the changes video captions should be visible
After I edit the component I should see status message "Timed Transcript Found"
"""
self
.
_create_video_component
()
self
.
edit_component
()
self
.
video
.
set_url_field
(
'/gizmo.webm'
,
1
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'No Timed Transcript'
)
self
.
video
.
upload_transcript
(
'uk_transcripts.srt'
)
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Uploaded Successfully'
)
self
.
open_advanced_tab
()
self
.
assertTrue
(
self
.
video
.
verify_field_value
(
'Default Timed Transcript'
,
'gizmo'
))
self
.
save_unit_settings
()
self
.
assertTrue
(
self
.
video
.
is_captions_visible
())
self
.
edit_component
()
self
.
assertEqual
(
self
.
video
.
message
(
'status'
),
'Timed Transcript Found'
)
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