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
26d35ac4
Commit
26d35ac4
authored
Jul 16, 2014
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4441 from edx/anton/fix-flaky--bok-choy-test
Video: fix flaky bok-choy test.
parents
18b7e6f5
37cccb85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
common/test/acceptance/pages/lms/video/video.py
+11
-2
common/test/acceptance/tests/video/test_video_module.py
+9
-4
No files found.
common/test/acceptance/pages/lms/video/video.py
View file @
26d35ac4
...
...
@@ -573,6 +573,10 @@ class VideoPage(PageObject):
return
True
def
current_language
(
self
,
video_display_name
=
None
):
selector
=
self
.
get_element_selector
(
video_display_name
,
VIDEO_MENUS
[
"language"
]
+
' li.is-active'
)
return
self
.
q
(
css
=
selector
)
.
first
.
attrs
(
'data-lang-code'
)[
0
]
def
select_language
(
self
,
code
,
video_display_name
=
None
):
"""
Select captions for language `code`.
...
...
@@ -587,13 +591,18 @@ class VideoPage(PageObject):
# mouse over to CC button
cc_button_selector
=
self
.
get_element_selector
(
video_display_name
,
VIDEO_BUTTONS
[
"CC"
])
element_to_hover_over
=
self
.
q
(
css
=
cc_button_selector
)
.
results
[
0
]
hover
=
ActionChains
(
self
.
browser
)
.
move_to_element
(
element_to_hover_over
)
hover
.
perform
()
ActionChains
(
self
.
browser
)
.
move_to_element
(
element_to_hover_over
)
.
perform
()
language_selector
=
VIDEO_MENUS
[
"language"
]
+
' li[data-lang-code="{code}"]'
.
format
(
code
=
code
)
language_selector
=
self
.
get_element_selector
(
video_display_name
,
language_selector
)
self
.
_wait_for_element_visibility
(
language_selector
,
'language menu is visible'
)
self
.
q
(
css
=
language_selector
)
.
first
.
click
()
# Sometimes language is not clicked correctly. So, if the current language code
# differs form the expected, we try to change it again.
if
self
.
current_language
(
video_display_name
)
!=
code
:
self
.
select_language
(
code
,
video_display_name
)
if
'is-active'
!=
self
.
q
(
css
=
language_selector
)
.
attrs
(
'class'
)[
0
]:
return
False
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
26d35ac4
...
...
@@ -18,7 +18,6 @@ from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from
..helpers
import
skip_if_browser
VIDEO_SOURCE_PORT
=
8777
YOUTUBE_STUB_PORT
=
9080
YOUTUBE_STUB_URL
=
'http://127.0.0.1:{}/'
.
format
(
YOUTUBE_STUB_PORT
)
...
...
@@ -498,7 +497,13 @@ class YouTubeVideoTest(VideoBaseTest):
# menu "download_transcript" doesn't exist
self
.
assertFalse
(
self
.
video
.
is_menu_exist
(
'download_transcript'
))
@skip
(
"Consistently failing on master BLD-1190 Disabled 11 July 2014"
)
def
_verify_caption_text
(
self
,
text
):
self
.
video
.
_wait_for
(
lambda
:
(
text
in
self
.
video
.
captions_text
()),
u'Captions contain "{}" text'
.
format
(
text
),
timeout
=
5
)
def
test_video_language_menu_working
(
self
):
"""
Scenario: Language menu works correctly in Video component
...
...
@@ -526,10 +531,10 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
video
.
select_language
(
'zh'
)
unicode_text
=
"好 各位同学"
.
decode
(
'utf-8'
)
self
.
assertIn
(
unicode_text
,
self
.
video
.
captions_text
()
)
self
.
_verify_caption_text
(
unicode_text
)
self
.
video
.
select_language
(
'en'
)
self
.
assertIn
(
'Hi, welcome to Edx.'
,
self
.
video
.
captions_text
()
)
self
.
_verify_caption_text
(
'Hi, welcome to Edx.'
)
def
test_multiple_videos_in_sequentials_load_and_work
(
self
):
"""
...
...
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