Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
0e237a85
Commit
0e237a85
authored
11 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Add acceptance test of the Graphical Slider Tool [LMS-1641]
parent
06fadcdc
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/features/gst.feature
+10
-0
10 additions, 0 deletions
lms/djangoapps/courseware/features/gst.feature
lms/djangoapps/courseware/features/gst.py
+76
-0
76 additions, 0 deletions
lms/djangoapps/courseware/features/gst.py
with
86 additions
and
0 deletions
lms/djangoapps/courseware/features/gst.feature
0 → 100644
+
10
−
0
View file @
0e237a85
@shard_2
Feature
:
LMS.Graphical Slider Tool Module
As a student, I want to view a Graphical Slider Tool Component
Scenario
:
The slider changes values on the page
Given
that I have a course with a Graphical Slider Tool
When
I view the Graphical Slider Tool
Then
the displayed value should be 0
And
I move the slider to the right
Then
the displayed value should be 10
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/gst.py
0 → 100644
+
76
−
0
View file @
0e237a85
from
lettuce
import
world
,
steps
from
nose.tools
import
assert_in
,
assert_equals
,
assert_true
from
common
import
i_am_registered_for_the_course
,
visit_scenario_item
from
problems_setup
import
add_problem_to_course
,
answer_problem
DEFAULT_DATA
=
"""
\
<render>
<p>Test of the graphical slider tool</p>
<div class=
'
gst-value
'
>
<span id=
"
value-display
"
style=
"
width:50px; float:left; margin-left:10px;
"
/>
</div>
<div class=
'
gst-input
'
>
<slider var=
"
a
"
style=
"
width:400px;float:left;margin-left:10px;
"
/>
</div>
</render>
<configuration>
<parameters>
<param var=
"
a
"
min=
"
0
"
max=
"
10
"
step=
"
1
"
initial=
"
0
"
/>
</parameters>
<functions>
<function output=
"
element
"
el_id=
"
value-display
"
>a</function>
</functions>
</configuration>
"""
@steps
class
GraphicalSliderToolSteps
(
object
):
COURSE_NUM
=
'
test_course
'
def
setup_gst
(
self
,
step
):
r
'
that I have a course with a Graphical Slider Tool$
'
i_am_registered_for_the_course
(
step
,
self
.
COURSE_NUM
)
world
.
scenario_dict
[
'
GST
'
]
=
world
.
ItemFactory
(
parent_location
=
world
.
scenario_dict
[
'
SECTION
'
].
location
,
category
=
'
graphical_slider_tool
'
,
display_name
=
"
Test GST
"
,
data
=
DEFAULT_DATA
)
def
view_gst
(
self
,
step
):
r
'
I view the Graphical Slider Tool$
'
visit_scenario_item
(
'
GST
'
)
world
.
wait_for_js_variable_truthy
(
'
$(
"
.xblock-student_view[data-type=GraphicalSliderTool]
"
).data(
"
initialized
"
)
'
)
world
.
wait_for_ajax_complete
()
def
check_value
(
self
,
step
,
value
):
r
'
the displayed value should be (?P<value>\d+)$
'
assert_equals
(
world
.
css_text
(
'
.gst-value
'
),
value
)
def
move_slider
(
self
,
step
):
r
'
I move the slider to the right$
'
handle_selector
=
'
.gst-input .ui-slider-handle
'
world
.
wait_for_visible
(
handle_selector
)
world
.
wait_for_visible
(
'
.gst-value #value-display
'
)
def
try_move
():
handle
=
world
.
css_find
(
handle_selector
).
first
slider
=
world
.
css_find
(
'
.gst-input .ui-slider
'
).
first
(
handle
.
action_chains
.
click_and_hold
(
handle
.
_element
)
.
move_by_offset
(
int
(
handle
.
_element
.
location
[
'
x
'
]
+
400
),
0
).
release
().
perform
())
world
.
retry_on_exception
(
try_move
)
GraphicalSliderToolSteps
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment