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
37d7bc23
Commit
37d7bc23
authored
Jun 11, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update lettuce test for problems with new css for show and hide answers.
parent
646e2bd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
lms/djangoapps/courseware/features/problems.feature
+5
-5
lms/djangoapps/courseware/features/problems.py
+13
-4
No files found.
lms/djangoapps/courseware/features/problems.feature
View file @
37d7bc23
...
...
@@ -112,10 +112,10 @@ Feature: Answer problems
Scenario
:
I can view and hide the answer if the problem has it
:
Given
I am viewing a
"numerical"
that shows the answer
"always"
When
I press the
"Show Answer"
button
Then
The
"Hide Answer"
button does appear
And
The
"Show Answer"
button does not appear
When
I press the
button with the label
"Show Answer(s)"
Then
The
"Hide Answer
(s)
"
button does appear
And
The
"Show Answer
(s)
"
button does not appear
And
I should see
"4.14159"
somewhere in the page
When
I press the
"Hide Answer"
button
Then
The
"Show Answer"
button does appear
When
I press the
button with the label
"Hide Answer(s)"
Then
The
"Show Answer
(s)
"
button does appear
And
I should not see
"4.14159"
anywhere on the page
lms/djangoapps/courseware/features/problems.py
View file @
37d7bc23
...
...
@@ -9,7 +9,7 @@ from lettuce import world, step
from
lettuce.django
import
django_url
from
common
import
i_am_registered_for_the_course
,
TEST_SECTION_NAME
from
problems_setup
import
PROBLEM_DICT
,
answer_problem
,
problem_has_answer
,
add_problem_to_course
from
nose.tools
import
assert_equal
,
assert_not_equal
@step
(
u'I am viewing a "([^"]*)" problem with "([^"]*)" attempt'
)
def
view_problem_with_attempts
(
step
,
problem_type
,
attempts
):
...
...
@@ -116,13 +116,22 @@ def reset_problem(step):
world
.
css_click
(
'input.reset'
)
@step
(
u'I press the button with the label "([^"]*)"$'
)
def
press_the_button_with_label
(
step
,
buttonname
):
button_css
=
'button span.show-label'
elem
=
world
.
css_find
(
button_css
)
.
first
assert_equal
(
elem
.
text
,
buttonname
)
elem
.
click
()
@step
(
u'The "([^"]*)" button does( not)? appear'
)
def
action_button_present
(
step
,
buttonname
,
doesnt_appear
):
button_css
=
'section.action input[value*="
%
s"]'
%
buttonname
button_css
=
'button span.show-label'
elem
=
world
.
css_find
(
button_css
)
.
first
if
doesnt_appear
:
assert
world
.
is_css_not_present
(
button_css
)
assert
_not_equal
(
elem
.
text
,
buttonname
)
else
:
assert
world
.
is_css_present
(
button_css
)
assert
_equal
(
elem
.
text
,
buttonname
)
@step
(
u'My "([^"]*)" answer is marked "([^"]*)"'
)
...
...
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