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
ca8bfa84
Commit
ca8bfa84
authored
Feb 20, 2015
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6941 from edx/anton/fix-flaky-tests
TNL-454: Fix flaky bok-choy tests.
parents
dfaae534
4b551b53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
27 deletions
+20
-27
common/test/acceptance/pages/lms/video/video.py
+3
-7
common/test/acceptance/tests/video/test_studio_video_module.py
+1
-0
common/test/acceptance/tests/video/test_video_times.py
+16
-20
No files found.
common/test/acceptance/pages/lms/video/video.py
View file @
ca8bfa84
...
@@ -356,10 +356,6 @@ class VideoPage(PageObject):
...
@@ -356,10 +356,6 @@ class VideoPage(PageObject):
self
.
q
(
css
=
button_selector
)
.
first
.
click
()
self
.
q
(
css
=
button_selector
)
.
first
.
click
()
button_states
=
{
'play'
:
'playing'
,
'pause'
:
'pause'
}
if
button
in
button_states
:
self
.
wait_for_state
(
button_states
[
button
])
self
.
wait_for_ajax
()
self
.
wait_for_ajax
()
def
_get_element_dimensions
(
self
,
selector
):
def
_get_element_dimensions
(
self
,
selector
):
...
@@ -677,7 +673,7 @@ class VideoPage(PageObject):
...
@@ -677,7 +673,7 @@ class VideoPage(PageObject):
elif
'is-ended'
in
current_state
:
elif
'is-ended'
in
current_state
:
return
'finished'
return
'finished'
def
_wait_for
(
self
,
check_func
,
desc
,
result
=
False
,
timeout
=
200
):
def
_wait_for
(
self
,
check_func
,
desc
,
result
=
False
,
timeout
=
200
,
try_interval
=
0.2
):
"""
"""
Calls the method provided as an argument until the Promise satisfied or BrokenPromise
Calls the method provided as an argument until the Promise satisfied or BrokenPromise
...
@@ -689,9 +685,9 @@ class VideoPage(PageObject):
...
@@ -689,9 +685,9 @@ class VideoPage(PageObject):
"""
"""
if
result
:
if
result
:
return
Promise
(
check_func
,
desc
,
timeout
=
timeout
)
.
fulfill
()
return
Promise
(
check_func
,
desc
,
timeout
=
timeout
,
try_interval
=
try_interval
)
.
fulfill
()
else
:
else
:
return
EmptyPromise
(
check_func
,
desc
,
timeout
=
timeout
)
.
fulfill
()
return
EmptyPromise
(
check_func
,
desc
,
timeout
=
timeout
,
try_interval
=
try_interval
)
.
fulfill
()
def
wait_for_state
(
self
,
state
):
def
wait_for_state
(
self
,
state
):
"""
"""
...
...
common/test/acceptance/tests/video/test_studio_video_module.py
View file @
ca8bfa84
...
@@ -181,6 +181,7 @@ class CMSVideoTest(CMSVideoBaseTest):
...
@@ -181,6 +181,7 @@ class CMSVideoTest(CMSVideoBaseTest):
self
.
assertTrue
(
self
.
video
.
is_button_shown
(
'play'
))
self
.
assertTrue
(
self
.
video
.
is_button_shown
(
'play'
))
self
.
video
.
click_player_button
(
'play'
)
self
.
video
.
click_player_button
(
'play'
)
self
.
video
.
wait_for_state
(
'playing'
)
self
.
assertTrue
(
self
.
video
.
is_button_shown
(
'pause'
))
self
.
assertTrue
(
self
.
video
.
is_button_shown
(
'pause'
))
def
test_youtube_stub_blocks_youtube_api
(
self
):
def
test_youtube_stub_blocks_youtube_api
(
self
):
...
...
common/test/acceptance/tests/video/test_video_times.py
View file @
ca8bfa84
...
@@ -3,7 +3,6 @@ Acceptance tests for Video Times(Start, End and Finish) functionality.
...
@@ -3,7 +3,6 @@ Acceptance tests for Video Times(Start, End and Finish) functionality.
"""
"""
from
.test_video_module
import
VideoBaseTest
from
.test_video_module
import
VideoBaseTest
from
unittest
import
skip
class
VideoTimesTest
(
VideoBaseTest
):
class
VideoTimesTest
(
VideoBaseTest
):
...
@@ -33,17 +32,16 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -33,17 +32,16 @@ class VideoTimesTest(VideoBaseTest):
self
.
assertGreaterEqual
(
int
(
self
.
video
.
position
.
split
(
':'
)[
1
]),
10
)
self
.
assertGreaterEqual
(
int
(
self
.
video
.
position
.
split
(
':'
)[
1
]),
10
)
@skip
(
"Intermittently fails 1 Oct 2014"
)
def
test_video_end_time_with_default_start_time
(
self
):
def
test_video_end_time_with_default_start_time
(
self
):
"""
"""
Scenario: End time works for Youtube video if starts playing from beginning.
Scenario: End time works for Youtube video if starts playing from beginning.
Given we have a video in "Youtube" mode with end time set to 00:00:0
2
Given we have a video in "Youtube" mode with end time set to 00:00:0
5
And I click video button "play"
And I click video button "play"
And I wait until video stop playing
And I wait until video stop playing
Then I see video slider at "0:0
2
" position
Then I see video slider at "0:0
5
" position
"""
"""
data
=
{
'end_time'
:
'00:00:0
2
'
}
data
=
{
'end_time'
:
'00:00:0
5
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
# go to video
...
@@ -54,7 +52,7 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -54,7 +52,7 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assert
Equal
(
self
.
video
.
position
,
'0:02'
)
self
.
assert
In
(
self
.
video
.
position
,
(
'0:05'
,
'0:06'
)
)
def
test_video_end_time_wo_default_start_time
(
self
):
def
test_video_end_time_wo_default_start_time
(
self
):
"""
"""
...
@@ -79,20 +77,19 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -79,20 +77,19 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assert
Equal
(
self
.
video
.
position
,
'1:00'
)
self
.
assert
In
(
self
.
video
.
position
,
(
'1:00'
,
'1:01'
)
)
@skip
(
"Intermittently fails 23 Sept 2014"
)
def
test_video_start_time_and_end_time
(
self
):
def
test_video_start_time_and_end_time
(
self
):
"""
"""
Scenario: Start time and end time work together for Youtube video.
Scenario: Start time and end time work together for Youtube video.
Given we a video in "Youtube" mode with start time set to 00:00:10 and end_time set to 00:00:1
2
Given we a video in "Youtube" mode with start time set to 00:00:10 and end_time set to 00:00:1
5
And I see video slider at "0:10" position
And I see video slider at "0:10" position
And I click video button "play"
And I click video button "play"
Then I wait until video stop playing
Then I wait until video stop playing
Then I see video slider at "0:1
2
" position
Then I see video slider at "0:1
5
" position
"""
"""
data
=
{
'start_time'
:
'00:00:10'
,
'end_time'
:
'00:00:1
2
'
}
data
=
{
'start_time'
:
'00:00:10'
,
'end_time'
:
'00:00:1
5
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
# go to video
...
@@ -105,13 +102,12 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -105,13 +102,12 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assert
Equal
(
self
.
video
.
position
,
'0:12'
)
self
.
assert
In
(
self
.
video
.
position
,
(
'0:15'
,
'0:16'
)
)
@skip
(
"Intermittently fails 03 June 2014"
)
def
test_video_end_time_and_finish_time
(
self
):
def
test_video_end_time_and_finish_time
(
self
):
"""
"""
Scenario: Youtube video works after pausing at end time and then plays again from End Time to the end.
Scenario: Youtube video works after pausing at end time and then plays again from End Time to the end.
Given we have a video in "Youtube" mode with start time set to 00:02:1
4
and end_time set to 00:02:15
Given we have a video in "Youtube" mode with start time set to 00:02:1
0
and end_time set to 00:02:15
And I click video button "play"
And I click video button "play"
And I wait until video stop playing
And I wait until video stop playing
Then I see video slider at "2:15" position
Then I see video slider at "2:15" position
...
@@ -119,7 +115,7 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -119,7 +115,7 @@ class VideoTimesTest(VideoBaseTest):
And I wait until video stop playing
And I wait until video stop playing
Then I see video slider at "2:20" position
Then I see video slider at "2:20" position
"""
"""
data
=
{
'start_time'
:
'00:02:1
4
'
,
'end_time'
:
'00:02:15'
}
data
=
{
'start_time'
:
'00:02:1
0
'
,
'end_time'
:
'00:02:15'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
# go to video
...
@@ -130,7 +126,7 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -130,7 +126,7 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assert
Equal
(
self
.
video
.
position
,
'2:15'
)
self
.
assert
In
(
self
.
video
.
position
,
(
'2:15'
,
'2:16'
)
)
self
.
video
.
click_player_button
(
'play'
)
self
.
video
.
click_player_button
(
'play'
)
...
@@ -142,14 +138,14 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -142,14 +138,14 @@ class VideoTimesTest(VideoBaseTest):
def
test_video_end_time_with_seek
(
self
):
def
test_video_end_time_with_seek
(
self
):
"""
"""
Scenario: End Time works for Youtube Video if starts playing before Start Time.
Scenario: End Time works for Youtube Video if starts playing before Start Time.
Given we have a video in "Youtube" mode with end-time at 0:3
2
and start-time at 0:30
Given we have a video in "Youtube" mode with end-time at 0:3
5
and start-time at 0:30
And I seek video to "0:28" position
And I seek video to "0:28" position
And I click video button "play"
And I click video button "play"
And I wait until video stop playing
And I wait until video stop playing
Then I see video slider at "0:3
2
" position
Then I see video slider at "0:3
5
" position
"""
"""
data
=
{
'start_time'
:
'00:00:30'
,
'end_time'
:
'00:00:3
2
'
}
data
=
{
'start_time'
:
'00:00:30'
,
'end_time'
:
'00:00:3
5
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
# go to video
...
@@ -162,7 +158,7 @@ class VideoTimesTest(VideoBaseTest):
...
@@ -162,7 +158,7 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assert
Equal
(
self
.
video
.
position
,
'0:32'
)
self
.
assert
In
(
self
.
video
.
position
,
(
'0:35'
,
'0:36'
)
)
def
test_video_finish_time_with_seek
(
self
):
def
test_video_finish_time_with_seek
(
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