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
e95ee994
Commit
e95ee994
authored
Oct 09, 2013
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add acceptance test instead of broken js unit test.
parent
7121db0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
38 deletions
+31
-38
cms/djangoapps/contentstore/features/video.feature
+8
-0
cms/djangoapps/contentstore/features/video.py
+23
-0
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
+0
-38
No files found.
cms/djangoapps/contentstore/features/video.feature
View file @
e95ee994
...
@@ -69,3 +69,11 @@ Feature: CMS.Video Component
...
@@ -69,3 +69,11 @@ Feature: CMS.Video Component
# Then Captions become "invisible" after 3 seconds
# Then Captions become "invisible" after 3 seconds
# And I hover over button "volume"
# And I hover over button "volume"
# Then Captions are "invisible"
# Then Captions are "invisible"
# 10
#Scenario: When enter key is pressed on a caption shows an outline around it
# Given I have created a Video component with subtitles
# And Make sure captions are opened
# Then I focus on caption line with data-index 0
# Then I press "enter" button on caption line with data-index 0
# And I see caption line with data-index 0 has class "focused"
cms/djangoapps/contentstore/features/video.py
View file @
e95ee994
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
lettuce
import
world
,
step
from
lettuce
import
world
,
step
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
contentstore.utils
import
get_modulestore
from
contentstore.utils
import
get_modulestore
from
selenium.webdriver.common.keys
import
Keys
BUTTONS
=
{
BUTTONS
=
{
'CC'
:
'.hide-subtitles'
,
'CC'
:
'.hide-subtitles'
,
...
@@ -154,3 +155,25 @@ def check_captions_visibility_state(_step, visibility_state, timeout):
...
@@ -154,3 +155,25 @@ def check_captions_visibility_state(_step, visibility_state, timeout):
assert
world
.
css_visible
(
'.subtitles'
)
assert
world
.
css_visible
(
'.subtitles'
)
else
:
else
:
assert
not
world
.
css_visible
(
'.subtitles'
)
assert
not
world
.
css_visible
(
'.subtitles'
)
def
find_caption_line_by_data_index
(
index
):
SELECTOR
=
".subtitles > li[data-index='{index}']"
.
format
(
index
=
index
)
return
world
.
css_find
(
SELECTOR
)
.
first
@step
(
'I focus on caption line with data-index (
\
d+)$'
)
def
focus_on_caption_line
(
_step
,
index
):
find_caption_line_by_data_index
(
int
(
index
.
strip
()))
.
_element
.
send_keys
(
Keys
.
TAB
)
@step
(
'I press "enter" button on caption line with data-index (
\
d+)$'
)
def
focus_on_caption_line
(
_step
,
index
):
find_caption_line_by_data_index
(
int
(
index
.
strip
()))
.
_element
.
send_keys
(
Keys
.
ENTER
)
@step
(
'I see caption line with data-index (
\
d+) has class "([^"]*)"$'
)
def
caption_line_has_class
(
_step
,
index
,
className
):
SELECTOR
=
".subtitles > li[data-index='{index}']"
.
format
(
index
=
int
(
index
.
strip
()))
world
.
css_has_class
(
SELECTOR
,
className
.
strip
())
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
View file @
e95ee994
...
@@ -756,44 +756,6 @@
...
@@ -756,44 +756,6 @@
expect
(
videoCaption
.
autoScrolling
).
toBe
(
true
);
expect
(
videoCaption
.
autoScrolling
).
toBe
(
true
);
});
});
});
});
describe
(
'when enter key is pressed on a caption'
,
function
()
{
var
assertCaptions
=
function
(
expectations
)
{
waitsFor
(
function
()
{
return
videoCaption
.
captions
.
length
;
},
"Captions are not loaded."
,
WAIT_TIMEOUT
);
runs
(
expectations
);
},
initializeClick
=
function
()
{
var
e
,
subDataLiIdx__0
=
$
(
'.subtitles li[data-index=0]'
);
spyOn
(
videoCaption
,
'seekPlayer'
).
andCallThrough
();
videoCaption
.
isMouseFocus
=
false
;
subDataLiIdx__0
.
trigger
(
jQuery
.
Event
(
'focus'
));
e
=
jQuery
.
Event
(
'keydown'
);
e
.
which
=
13
;
// ENTER key
subDataLiIdx__0
.
trigger
(
e
);
};
it
(
'shows an outline around it'
,
function
()
{
assertCaptions
(
function
()
{
var
subDataLiIdx__0
=
$
(
'.subtitles li[data-index=0]'
);
initializeClick
();
expect
(
subDataLiIdx__0
).
toHaveClass
(
'focused'
);
});
});
it
(
'calls seekPlayer'
,
function
()
{
assertCaptions
(
function
()
{
initializeClick
();
expect
(
videoCaption
.
seekPlayer
).
toHaveBeenCalled
();
});
});
});
});
});
});
});
...
...
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